PPCConfiguration refactoring [1/10]: renamed PPCArguments to PPCCompilationOptions
Renamed PPCConfiguration>>#arguments/#arguments: to #options/#options:
--- a/compiler/Make.proto Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/Make.proto Mon Aug 24 23:42:53 2015 +0100
@@ -136,13 +136,13 @@
$(OUTDIR)PEGFsaStateInfo.$(O) PEGFsaStateInfo.$(H): PEGFsaStateInfo.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)PEGFsaTransition.$(O) PEGFsaTransition.$(H): PEGFsaTransition.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)PPCASTUtilities.$(O) PPCASTUtilities.$(H): PPCASTUtilities.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)PPCArguments.$(O) PPCArguments.$(H): PPCArguments.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)PPCBridge.$(O) PPCBridge.$(H): PPCBridge.st $(INCLUDE_TOP)/stx/goodies/petitparser/PPParser.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)PPCClass.$(O) PPCClass.$(H): PPCClass.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)PPCClassBuilder.$(O) PPCClassBuilder.$(H): PPCClassBuilder.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)PPCCodeBlock.$(O) PPCCodeBlock.$(H): PPCCodeBlock.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)PPCCodeGen.$(O) PPCCodeGen.$(H): PPCCodeGen.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(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)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)
--- a/compiler/Make.spec Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/Make.spec Mon Aug 24 23:42:53 2015 +0100
@@ -62,13 +62,13 @@
PEGFsaStateInfo \
PEGFsaTransition \
PPCASTUtilities \
- PPCArguments \
PPCBridge \
PPCClass \
PPCClassBuilder \
PPCCodeBlock \
PPCCodeGen \
PPCCompilationError \
+ PPCCompilationOptions \
PPCCompilationWarning \
PPCConfiguration \
PPCContext \
@@ -192,13 +192,13 @@
$(OUTDIR_SLASH)PEGFsaStateInfo.$(O) \
$(OUTDIR_SLASH)PEGFsaTransition.$(O) \
$(OUTDIR_SLASH)PPCASTUtilities.$(O) \
- $(OUTDIR_SLASH)PPCArguments.$(O) \
$(OUTDIR_SLASH)PPCBridge.$(O) \
$(OUTDIR_SLASH)PPCClass.$(O) \
$(OUTDIR_SLASH)PPCClassBuilder.$(O) \
$(OUTDIR_SLASH)PPCCodeBlock.$(O) \
$(OUTDIR_SLASH)PPCCodeGen.$(O) \
$(OUTDIR_SLASH)PPCCompilationError.$(O) \
+ $(OUTDIR_SLASH)PPCCompilationOptions.$(O) \
$(OUTDIR_SLASH)PPCCompilationWarning.$(O) \
$(OUTDIR_SLASH)PPCConfiguration.$(O) \
$(OUTDIR_SLASH)PPCContext.$(O) \
--- a/compiler/PPCArguments.st Mon Aug 24 22:32:15 2015 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-"{ Package: 'stx:goodies/petitparser/compiler' }"
-
-"{ NameSpace: Smalltalk }"
-
-Object subclass:#PPCArguments
- instanceVariableNames:'arguments'
- classVariableNames:''
- poolDictionaries:''
- category:'PetitCompiler-Core'
-!
-
-!PPCArguments class methodsFor:'as yet unclassified'!
-
-default
- ^ self new
-!
-
-new
- ^ self basicNew
- initialize;
- yourself
-! !
-
-!PPCArguments methodsFor:'accessing'!
-
-cacheFirstFollow
- ^ self at: #cacheFirstFollow ifAbsent: true
-!
-
-cacheFirstFollow: value
- self set: #cacheFirstFollow to: value.
-!
-
-codeGenerator
- self error: 'deprecated?'.
- ^ self at: #codeGenerator ifAbsent: PPCCodeGenerator
-!
-
-codeGenerator: value
- self set: #codeGenerator to: value.
-!
-
-debug
- ^ self at: #debug ifAbsent: true
-!
-
-debug: value
- self set: #debug to: value.
-!
-
-detectTokens
- ^ self at: #detectTokens ifAbsent: true
-!
-
-detectTokens: value
- self set: #detectTokens to: value.
-!
-
-generate
- ^ self at: #generate ifAbsent: true
-!
-
-generate: value
- ^ self set: #generate to: value
-!
-
-guards
- ^ self at: #guards ifAbsent: true
-!
-
-guards: value
- self set: #guards to: value.
-!
-
-inline
- ^ self at: #inline ifAbsent: true
-!
-
-inline: value
- self set: #inline to: value.
-!
-
-merge
- ^ self at: #merge ifAbsent: true
-!
-
-merge: value
- self set: #merge to: value.
-!
-
-parserName
- ^ self at: #parserName ifAbsent: #PPGeneratedParser
-!
-
-parserName: value
- self set: #parserName to: value.
-!
-
-parserSuperclass
- ^ self at: #parserSuperclass ifAbsent: PPTokenizingCompiledParser
-!
-
-parserSuperclass: value
- self set: #parserSuperclass to: value.
-!
-
-profile
- ^ self at: #profile ifAbsent: false
-!
-
-profile: value
- self set: #profile to: value.
-!
-
-recognizingComponents
- ^ self at: #recognizingComponents ifAbsent: true
-!
-
-recognizingComponents: value
- self set: #recognizingComponents to: value.
-!
-
-scannerName
- ^ self at: #scannerName ifAbsent: #PPGeneratedScanner
-!
-
-scannerName: value
- self set: #scannerName to: value.
-!
-
-scannerSuperclass
- ^ self at: #scannerSuperclass ifAbsent: PPCDistinctScanner
-!
-
-scannerSuperclass: value
- self set: #scannerSuperclass to: value.
-!
-
-specialize
- ^ self at: #specialize ifAbsent: true
-!
-
-specialize: value
- self set: #specialize to: value.
-!
-
-tokenize
- ^ self at: #tokenize ifAbsent: true
-!
-
-tokenize: value
- self set: #tokenize to: value.
-! !
-
-!PPCArguments methodsFor:'initialization'!
-
-initialize
- super initialize.
- arguments := IdentityDictionary new
-! !
-
-!PPCArguments methodsFor:'private'!
-
-at: symbol ifAbsent: defaultValue
- ^ arguments at: symbol ifAbsent: [ ^ defaultValue ]
-!
-
-set: symbol to: defaultValue
- ^ arguments at: symbol put: defaultValue
-! !
-
--- a/compiler/PPCClass.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/PPCClass.st Mon Aug 24 23:42:53 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
Object subclass:#PPCClass
- instanceVariableNames:'methodDictionary currentMethod constants idGen arguments
+ instanceVariableNames:'methodDictionary currentMethod constants idGen options
methodStack returnVariable properties'
classVariableNames:''
poolDictionaries:''
@@ -20,8 +20,8 @@
!PPCClass methodsFor:'accessing'!
-arguments: args
- arguments := args
+options: args
+ options := args
!
constants
--- a/compiler/PPCCodeGen.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/PPCCodeGen.st Mon Aug 24 23:42:53 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
Object subclass:#PPCCodeGen
- instanceVariableNames:'clazz arguments'
+ instanceVariableNames:'clazz options'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Compiler-Codegen'
@@ -14,7 +14,9 @@
new
"return an initialized instance"
- ^ self on: PPCArguments default
+ ^ self on: PPCCompilationOptions default
+
+ "Modified: / 24-08-2015 / 23:39:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
on: aPPCArguments
@@ -22,15 +24,11 @@
^ self basicNew
initialize;
- arguments: aPPCArguments
+ options: aPPCArguments
! !
!PPCCodeGen methodsFor:'accessing'!
-arguments: args
- arguments := args
-!
-
clazz
^ clazz
!
@@ -57,6 +55,10 @@
methodCategory
^ 'generated'
+!
+
+options: args
+ options := args
! !
!PPCCodeGen methodsFor:'caching'!
@@ -121,7 +123,7 @@
clazz currentMethod isInline ifTrue: [
"If inlined, the return variable already holds the value"
] ifFalse: [
- arguments profile ifTrue:[
+ options profile ifTrue:[
self codeProfileStop.
].
self code: '^ ', clazz currentMethod returnVariable
@@ -137,7 +139,7 @@
clazz currentMethod isInline ifTrue:[
self codeEvaluateAndAssign: code to: clazz currentMethod returnVariable.
] ifFalse: [
- arguments profile ifTrue:[
+ options profile ifTrue:[
self codeProfileStop.
].
self code: '^ '.
@@ -264,7 +266,7 @@
!
codeHaltIfShiftPressed
- arguments debug ifTrue: [
+ options debug ifTrue: [
((Smalltalk respondsTo: #isSmalltalkX) and:[Smalltalk isSmalltalkX]) ifFalse:[
self code: 'Halt ifShiftPressed.'
]
@@ -286,13 +288,13 @@
!
codeTranscriptShow: text
- (arguments profile) ifTrue: [
+ (options profile) ifTrue: [
self code: 'Transcript show: ', text storeString, '; cr.'.
]
!
profileTokenRead: tokenName
- arguments profile ifTrue: [
+ options profile ifTrue: [
self code: 'context tokenRead: ', tokenName storeString, '.'
]
! !
@@ -435,7 +437,7 @@
startMethod: id
clazz startMethod: id category: self methodCategory.
- arguments profile ifTrue:[
+ options profile ifTrue:[
self codeProfileStart.
].
!
--- a/compiler/PPCCodeGenerator.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/PPCCodeGenerator.st Mon Aug 24 23:42:53 2015 +0100
@@ -25,9 +25,9 @@
!PPCCodeGenerator methodsFor:'accessing'!
-arguments: args
- super arguments: args.
- codeGen arguments: args.
+options: args
+ super options: args.
+ codeGen options: args.
!
clazz: aPPCClass
@@ -43,7 +43,7 @@
!
guards
- ^ arguments guards
+ ^ options guards
! !
!PPCCodeGenerator methodsFor:'code generation'!
@@ -340,8 +340,8 @@
parent := variableNode parent.
"Check for <barg> at: <number>"
- ((parent selector == #at:) and:[ parent arguments first isLiteralNumber ]) ifTrue:[
- blockMatches at: parent put: (childValueVars at: parent arguments first value).
+ ((parent selector == #at:) and:[ parent options first isLiteralNumber ]) ifTrue:[
+ blockMatches at: parent put: (childValueVars at: parent options first value).
] ifFalse:[
"Check for <barg> first / second / ..."
| i |
@@ -951,7 +951,7 @@
self compileTokenWhitespace: node.
- (arguments guards and: [(guard := PPCGuard on: node) makesSense]) ifTrue: [
+ (options guards and: [(guard := PPCGuard on: node) makesSense]) ifTrue: [
guard id: id, '_guard'.
codeGen code: 'context atEnd ifTrue: [ self error ].'.
guard compileGuard: codeGen.
@@ -963,7 +963,7 @@
codeGen codeAssign: 'context position + 1.' to: startVar.
codeGen codeEvaluateAndAssign:[ self visit:node child ] to:#whatever.
- (arguments guards and: [(guard := PPCGuard on: node) makesSense]) ifTrue: [
+ (options guards and: [(guard := PPCGuard on: node) makesSense]) ifTrue: [
codeGen dedent.
codeGen code: '].'.
].
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/compiler/PPCCompilationOptions.st Mon Aug 24 23:42:53 2015 +0100
@@ -0,0 +1,171 @@
+"{ Package: 'stx:goodies/petitparser/compiler' }"
+
+"{ NameSpace: Smalltalk }"
+
+Object subclass:#PPCCompilationOptions
+ instanceVariableNames:'options'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'PetitCompiler-Core'
+!
+
+!PPCCompilationOptions class methodsFor:'as yet unclassified'!
+
+default
+ ^ self new
+!
+
+new
+ ^ self basicNew
+ initialize;
+ yourself
+! !
+
+!PPCCompilationOptions methodsFor:'accessing'!
+
+cacheFirstFollow
+ ^ self at: #cacheFirstFollow ifAbsent: true
+!
+
+cacheFirstFollow: value
+ self set: #cacheFirstFollow to: value.
+!
+
+codeGenerator
+ self error: 'deprecated?'.
+ ^ self at: #codeGenerator ifAbsent: PPCCodeGenerator
+!
+
+codeGenerator: value
+ self set: #codeGenerator to: value.
+!
+
+debug
+ ^ self at: #debug ifAbsent: true
+!
+
+debug: value
+ self set: #debug to: value.
+!
+
+detectTokens
+ ^ self at: #detectTokens ifAbsent: true
+!
+
+detectTokens: value
+ self set: #detectTokens to: value.
+!
+
+generate
+ ^ self at: #generate ifAbsent: true
+!
+
+generate: value
+ ^ self set: #generate to: value
+!
+
+guards
+ ^ self at: #guards ifAbsent: true
+!
+
+guards: value
+ self set: #guards to: value.
+!
+
+inline
+ ^ self at: #inline ifAbsent: true
+!
+
+inline: value
+ self set: #inline to: value.
+!
+
+merge
+ ^ self at: #merge ifAbsent: true
+!
+
+merge: value
+ self set: #merge to: value.
+!
+
+parserName
+ ^ self at: #parserName ifAbsent: #PPGeneratedParser
+!
+
+parserName: value
+ self set: #parserName to: value.
+!
+
+parserSuperclass
+ ^ self at: #parserSuperclass ifAbsent: PPTokenizingCompiledParser
+!
+
+parserSuperclass: value
+ self set: #parserSuperclass to: value.
+!
+
+profile
+ ^ self at: #profile ifAbsent: false
+!
+
+profile: value
+ self set: #profile to: value.
+!
+
+recognizingComponents
+ ^ self at: #recognizingComponents ifAbsent: true
+!
+
+recognizingComponents: value
+ self set: #recognizingComponents to: value.
+!
+
+scannerName
+ ^ self at: #scannerName ifAbsent: #PPGeneratedScanner
+!
+
+scannerName: value
+ self set: #scannerName to: value.
+!
+
+scannerSuperclass
+ ^ self at: #scannerSuperclass ifAbsent: PPCDistinctScanner
+!
+
+scannerSuperclass: value
+ self set: #scannerSuperclass to: value.
+!
+
+specialize
+ ^ self at: #specialize ifAbsent: true
+!
+
+specialize: value
+ self set: #specialize to: value.
+!
+
+tokenize
+ ^ self at: #tokenize ifAbsent: true
+!
+
+tokenize: value
+ self set: #tokenize to: value.
+! !
+
+!PPCCompilationOptions methodsFor:'initialization'!
+
+initialize
+ super initialize.
+ options := IdentityDictionary new
+! !
+
+!PPCCompilationOptions methodsFor:'private'!
+
+at: symbol ifAbsent: defaultValue
+ ^ options at: symbol ifAbsent: [ ^ defaultValue ]
+!
+
+set: symbol to: defaultValue
+ ^ options at: symbol put: defaultValue
+! !
+
--- a/compiler/PPCConfiguration.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/PPCConfiguration.st Mon Aug 24 23:42:53 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
Object subclass:#PPCConfiguration
- instanceVariableNames:'arguments ir history'
+ instanceVariableNames:'options ir history'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Core'
@@ -31,17 +31,10 @@
!PPCConfiguration methodsFor:'accessing'!
-arguments
- arguments isNil ifTrue: [ arguments := self defaultArguments ].
- ^ arguments
-!
+defaultArguments
+ ^ PPCCompilationOptions default
-arguments: args
- arguments := args
-!
-
-defaultArguments
- ^ PPCArguments default
+ "Modified: / 24-08-2015 / 23:39:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
input: whatever
@@ -56,6 +49,15 @@
ir: whatever
ir := whatever
+!
+
+options
+ options isNil ifTrue: [ options := self defaultArguments ].
+ ^ options
+!
+
+options: args
+ options := args
! !
!PPCConfiguration methodsFor:'caching'!
@@ -141,13 +143,13 @@
remember: key
self deprecated: 'use remember:as:'.
- self arguments debug ifTrue: [
+ self options debug ifTrue: [
history add: key -> (self copy: ir).
]
!
remember: value as: key
- self arguments debug ifTrue: [
+ self options debug ifTrue: [
history add: key -> value.
]
! !
@@ -156,13 +158,15 @@
initialize
history := OrderedCollection new.
- arguments := PPCArguments default.
+ options := PPCCompilationOptions default.
+
+ "Modified: / 24-08-2015 / 23:39:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!PPCConfiguration methodsFor:'phases'!
cacheFirstFollow
- arguments cacheFirstFollow ifFalse: [ ^ self ] .
+ options cacheFirstFollow ifFalse: [ ^ self ] .
self cacheFirstSet.
self cacheFollowSet.
@@ -175,30 +179,30 @@
!
createRecognizingComponents
- arguments recognizingComponents ifFalse: [ ^ self ] .
+ options recognizingComponents ifFalse: [ ^ self ] .
ir := PPCRecognizerComponentDetector new
- arguments: arguments;
+ options: options;
visit: ir.
self remember: (self copyTree: ir) as: #recognizingComponents
!
createTokens
- arguments detectTokens ifFalse: [ ^ self ] .
+ options detectTokens ifFalse: [ ^ self ] .
ir := PPCTokenDetector new
- arguments: arguments;
+ options: options;
visit: ir.
self remember: (self copyTree: ir) as: #createTokens
!
inline
- arguments inline ifFalse: [ ^ self ].
+ options inline ifFalse: [ ^ self ].
ir := PPCInliningVisitor new
- arguments: arguments;
+ options: options;
visit: ir.
self remember: (self copyTree: ir) as: #inline.
@@ -206,17 +210,17 @@
merge
"Merge equivalent nodes under one object with single identity"
- arguments merge ifFalse: [ ^ self ].
+ options merge ifFalse: [ ^ self ].
ir := PPCMergingVisitor new
- arguments: arguments;
+ options: options;
visit: ir.
self remember: (self copyTree: ir) as: #merge
!
specialize
- arguments specialize ifFalse: [ ^ self ].
+ options specialize ifFalse: [ ^ self ].
"
Invokes a visitor that creates specialized nodes
@@ -225,7 +229,7 @@
e.g. $a astar can be represented by PPCCharacterStarNode
"
ir := (PPCSpecializingVisitor new
- arguments: arguments;
+ options: options;
visit: ir).
self remember: (self copyTree: ir) as: #specialize
@@ -241,7 +245,7 @@
!PPCConfiguration methodsFor:'reporting'!
reportTime: timeInMs
- arguments profile ifTrue: [
+ options profile ifTrue: [
Transcript show: 'Time to compile: ', timeInMs asString, ' ms'; cr.
]
! !
--- a/compiler/PPCFSACodeGen.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/PPCFSACodeGen.st Mon Aug 24 23:42:53 2015 +0100
@@ -173,7 +173,7 @@
!
codeReturn: code
- arguments profile ifTrue:[
+ options profile ifTrue:[
self codeProfileStop.
].
self code: '^ '.
--- a/compiler/PPCNodeVisitor.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/PPCNodeVisitor.st Mon Aug 24 23:42:53 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
Object subclass:#PPCNodeVisitor
- instanceVariableNames:'openSet closeSet cache arguments'
+ instanceVariableNames:'openSet closeSet cache options'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Visitors'
@@ -17,8 +17,8 @@
!PPCNodeVisitor methodsFor:'accessing'!
-arguments: args
- arguments := args
+options: args
+ options := args
! !
!PPCNodeVisitor methodsFor:'hooks'!
--- a/compiler/PPCPluggableConfiguration.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/PPCPluggableConfiguration.st Mon Aug 24 23:42:53 2015 +0100
@@ -24,8 +24,8 @@
!PPCPluggableConfiguration methodsFor:'as yet unclassified'!
-arguments: args
- ^ base arguments: args
+options: args
+ ^ base options: args
!
base: aPPCConfiguration
--- a/compiler/PPCScanner.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/PPCScanner.st Mon Aug 24 23:42:53 2015 +0100
@@ -10,6 +10,7 @@
category:'PetitCompiler-Scanner'
!
+
!PPCScanner class methodsFor:'as yet unclassified'!
acceptsLoggingOfCompilation
@@ -257,3 +258,10 @@
^ (matchPosition == nil) not
! !
+!PPCScanner class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/PPCScannerCodeGenerator.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/PPCScannerCodeGenerator.st Mon Aug 24 23:42:53 2015 +0100
@@ -3,8 +3,7 @@
"{ NameSpace: Smalltalk }"
Object subclass:#PPCScannerCodeGenerator
- instanceVariableNames:'codeGen fsa arguments incommingTransitions resultStrategy
- fsaCache'
+ instanceVariableNames:'codeGen fsa options incommingTransitions resultStrategy fsaCache'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Scanner'
@@ -20,21 +19,21 @@
!PPCScannerCodeGenerator methodsFor:'accessing'!
-arguments
- ^ arguments
-!
-
-arguments: anObject
- arguments := anObject.
- codeGen arguments: anObject.
-!
-
codeGen
^ codeGen
!
compiler
^ self codeGen
+!
+
+options
+ ^ options
+!
+
+options: anObject
+ options := anObject.
+ codeGen options: anObject.
! !
!PPCScannerCodeGenerator methodsFor:'analysis'!
@@ -410,8 +409,8 @@
builder := PPCClassBuilder new.
- builder compiledClassName: arguments scannerName.
- builder compiledSuperclass: arguments scannerSuperclass.
+ builder compiledClassName: options scannerName.
+ builder compiledSuperclass: options scannerSuperclass.
builder methodDictionary: codeGen clazz methodDictionary.
builder constants: codeGen clazz constants.
@@ -424,7 +423,9 @@
super initialize.
codeGen := PPCFSACodeGen new.
- arguments := PPCArguments default.
+ options := PPCCompilationOptions default.
fsaCache := IdentityDictionary new.
+
+ "Modified: / 24-08-2015 / 23:39:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
--- a/compiler/PPCTokenCodeGenerator.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/PPCTokenCodeGenerator.st Mon Aug 24 23:42:53 2015 +0100
@@ -11,9 +11,9 @@
!PPCTokenCodeGenerator methodsFor:'accessing'!
-arguments: args
- super arguments: args.
- codeGen arguments: args.
+options: args
+ super options: args.
+ codeGen options: args.
!
clazz: aPPCClass
--- a/compiler/PPCTokenizingConfiguration.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/PPCTokenizingConfiguration.st Mon Aug 24 23:42:53 2015 +0100
@@ -11,8 +11,8 @@
!PPCTokenizingConfiguration methodsFor:'compiling'!
-arguments: args
- super arguments: args.
+options: args
+ super options: args.
!
buildClass: clazz
@@ -53,11 +53,11 @@
!PPCTokenizingConfiguration methodsFor:'initialization'!
fillInClazzes
- parserClazz name: arguments parserName.
+ parserClazz name: options parserName.
parserClazz superclass: PPTokenizingCompiledParser.
- scannerClazz name: arguments scannerName.
- scannerClazz superclass: arguments scannerSuperclass.
+ scannerClazz name: options scannerName.
+ scannerClazz superclass: options scannerSuperclass.
!
@@ -82,7 +82,7 @@
| rootMethod |
rootMethod := PPCTokenizingCodeGenerator new
clazz: parserClazz;
- arguments: arguments;
+ options: options;
visit: ir.
parserClazz propertyAt: #rootMethod put: rootMethod
@@ -99,7 +99,7 @@
generator := PPCScannerCodeGenerator new
clazz: scannerClazz;
- arguments: arguments;
+ options: options;
yourself.
fsas do: [ :fsa | generator generate: fsa ].
@@ -109,7 +109,7 @@
| generator |
generator := PPCTokenCodeGenerator new
clazz: scannerClazz;
- arguments: arguments;
+ options: options;
yourself.
generator visit: ir.
@@ -127,7 +127,7 @@
self flag: 'This phase needs revisit and update'.
ir := PPCLL1Visitor new
- arguments: arguments;
+ options: options;
visit: ir.
self remember: (self copyTree: ir) as: #LL1
@@ -135,11 +135,11 @@
generateParser
| parserClass rootMethod |
- arguments generate ifFalse: [ ^ self ].
+ options generate ifFalse: [ ^ self ].
rootMethod := parserClazz propertyAt: #rootMethod.
- parserClazz name: arguments parserName.
- parserClazz superclass: arguments parserSuperclass.
+ parserClazz name: options parserName.
+ parserClazz superclass: options parserSuperclass.
parserClass := self buildClass: parserClazz.
parserClass startSymbol: rootMethod methodName.
@@ -152,10 +152,10 @@
generateScanner
| scanner |
- arguments generate ifFalse: [ ^ self ].
+ options generate ifFalse: [ ^ self ].
- scannerClazz name: arguments scannerName.
- scannerClazz superclass: arguments scannerSuperclass.
+ scannerClazz name: options scannerName.
+ scannerClazz superclass: options scannerSuperclass.
scanner := (self buildClass: scannerClazz).
parserClazz addConstant: scanner as: #scannerClass.
@@ -169,10 +169,10 @@
"
This will try transform the parser into the tokenizing parser
"
- arguments tokenize ifFalse: [ ^ self ] .
+ options tokenize ifFalse: [ ^ self ] .
ir := PPCTokenizingVisitor new
- arguments: arguments;
+ options: options;
visit: ir.
--- a/compiler/PPCUniversalConfiguration.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/PPCUniversalConfiguration.st Mon Aug 24 23:42:53 2015 +0100
@@ -17,7 +17,7 @@
builder := PPCClassBuilder new.
- builder compiledClassName: arguments parserName.
+ builder compiledClassName: options parserName.
builder compiledSuperclass: PPCompiledParser.
builder methodDictionary: clazz methodDictionary.
builder constants: clazz constants.
@@ -48,17 +48,17 @@
codeGenerator
^ PPCUniversalCodeGenerator new
- arguments: arguments
+ options: options
! !
!PPCUniversalConfiguration methodsFor:'phases'!
generate
| rootMethod compiledParser |
- arguments generate ifFalse: [ ^ self ].
+ options generate ifFalse: [ ^ self ].
rootMethod := self codeGenerator
- arguments: arguments;
+ options: options;
clazz: clazz;
visit: ir.
--- a/compiler/abbrev.stc Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/abbrev.stc Mon Aug 24 23:42:53 2015 +0100
@@ -12,13 +12,13 @@
PEGFsaStateInfo PEGFsaStateInfo stx:goodies/petitparser/compiler 'PetitCompiler-FSA' 0
PEGFsaTransition PEGFsaTransition stx:goodies/petitparser/compiler 'PetitCompiler-FSA' 0
PPCASTUtilities PPCASTUtilities stx:goodies/petitparser/compiler 'PetitCompiler-Support' 0
-PPCArguments PPCArguments stx:goodies/petitparser/compiler 'PetitCompiler-Core' 0
PPCBridge PPCBridge stx:goodies/petitparser/compiler 'PetitCompiler-Core' 0
PPCClass PPCClass stx:goodies/petitparser/compiler 'PetitCompiler-Compiler-Codegen' 0
PPCClassBuilder PPCClassBuilder stx:goodies/petitparser/compiler 'PetitCompiler-Core' 0
PPCCodeBlock PPCCodeBlock stx:goodies/petitparser/compiler 'PetitCompiler-Compiler-Codegen' 0
PPCCodeGen PPCCodeGen stx:goodies/petitparser/compiler 'PetitCompiler-Compiler-Codegen' 0
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
PPCContext PPCContext stx:goodies/petitparser/compiler 'PetitCompiler-Context' 0
--- a/compiler/bc.mak Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/bc.mak Mon Aug 24 23:42:53 2015 +0100
@@ -83,13 +83,13 @@
$(OUTDIR)PEGFsaStateInfo.$(O) PEGFsaStateInfo.$(H): PEGFsaStateInfo.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)PEGFsaTransition.$(O) PEGFsaTransition.$(H): PEGFsaTransition.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)PPCASTUtilities.$(O) PPCASTUtilities.$(H): PPCASTUtilities.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)PPCArguments.$(O) PPCArguments.$(H): PPCArguments.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)PPCBridge.$(O) PPCBridge.$(H): PPCBridge.st $(INCLUDE_TOP)\stx\goodies\petitparser\PPParser.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)PPCClass.$(O) PPCClass.$(H): PPCClass.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)PPCClassBuilder.$(O) PPCClassBuilder.$(H): PPCClassBuilder.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)PPCCodeBlock.$(O) PPCCodeBlock.$(H): PPCCodeBlock.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)PPCCodeGen.$(O) PPCCodeGen.$(H): PPCCodeGen.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(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)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)
--- a/compiler/benchmarks/PPCBenchmark.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/benchmarks/PPCBenchmark.st Mon Aug 24 23:42:53 2015 +0100
@@ -549,8 +549,8 @@
setupExpressionGrammarCompiled
configuration := PPCConfiguration universal.
- configuration arguments parserName: #PPCompiledExpressionGrammar.
- configuration arguments scannerName: #PPCompiledExpressionScanner.
+ configuration options parserName: #PPCompiledExpressionGrammar.
+ configuration options scannerName: #PPCompiledExpressionScanner.
parser := PPExpressionGrammar new compileWithConfiguration: configuration.
context := self context.
context initializeFor: parser.
@@ -560,8 +560,8 @@
setupExpressionGrammarTokenized
configuration := PPCConfiguration tokenizing.
- configuration arguments parserName: #PPTokenizedExpressionGrammar.
- configuration arguments scannerName: #PPTokenizedExpressionScanner.
+ configuration options parserName: #PPTokenizedExpressionGrammar.
+ configuration options scannerName: #PPTokenizedExpressionScanner.
parser := PPExpressionGrammar new compileWithConfiguration: configuration.
context := self context.
context initializeFor: parser.
@@ -600,8 +600,8 @@
setupLL1ExpressionGrammarCompiled
configuration := PPCConfiguration universal.
- configuration arguments parserName: #PPCompiledLL1ExpressionGrammar.
- configuration arguments scannerName: #PPCompiledLL1ExpressionScanner.
+ configuration options parserName: #PPCompiledLL1ExpressionGrammar.
+ configuration options scannerName: #PPCompiledLL1ExpressionScanner.
parser := PPLL1ExpressionGrammar new compileWithConfiguration: configuration.
context := self context.
context initializeFor: parser.
@@ -611,8 +611,8 @@
setupLL1ExpressionGrammarTokenized
configuration := PPCConfiguration tokenizing.
- configuration arguments parserName: #PPTokenizedLL1ExpressionGrammar.
- configuration arguments scannerName: #PPTokenizedLL1ExpressionScanner.
+ configuration options parserName: #PPTokenizedLL1ExpressionGrammar.
+ configuration options scannerName: #PPTokenizedLL1ExpressionScanner.
parser := PPLL1ExpressionGrammar new compileWithConfiguration: configuration.
context := self context.
context initializeFor: parser.
@@ -666,8 +666,8 @@
setupSmalltalkGrammarCompiled
configuration := PPCConfiguration universal.
- configuration arguments parserName: #PPSmalltalkGrammarC_Unviersal.
- configuration arguments profile: profile.
+ configuration options parserName: #PPSmalltalkGrammarC_Unviersal.
+ configuration options profile: profile.
parser := PPSmalltalkGrammar new compileWithConfiguration: configuration.
context := self context.
@@ -683,9 +683,9 @@
setupSmalltalkGrammarTokenized
configuration := PPCConfiguration tokenizing.
- configuration arguments parserName: #PPSmalltalkGrammarC_Tokenizing.
- configuration arguments scannerName: #PPSmalltalkGrammarC_Scanner.
- configuration arguments profile: profile.
+ configuration options parserName: #PPSmalltalkGrammarC_Tokenizing.
+ configuration options scannerName: #PPSmalltalkGrammarC_Scanner.
+ configuration options profile: profile.
parser := PPSmalltalkGrammar new compileWithConfiguration: configuration.
context := self context.
--- a/compiler/benchmarks/PPCLRPParser_johanfabry_39.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/benchmarks/PPCLRPParser_johanfabry_39.st Mon Aug 24 23:42:53 2015 +0100
@@ -64,7 +64,7 @@
].
compiled := (self methodizeBlock: aBlockNode withArguments: keys) compiledMethod.
- retval := compiled valueWithReceiver: Object new arguments: {aDictionary}.
+ retval := compiled valueWithReceiver: Object new options: {aDictionary}.
^retval.
!
--- a/compiler/extensions.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/extensions.st Mon Aug 24 23:42:53 2015 +0100
@@ -399,33 +399,39 @@
!PPParser methodsFor:'*petitcompiler'!
compile
- ^ self compile: PPCArguments default
+ ^ self compile: PPCCompilationOptions default
+
+ "Modified: / 24-08-2015 / 23:39:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!PPParser methodsFor:'*petitcompiler'!
-compile: arguments
- self assert: (arguments isKindOf: PPCArguments).
+compile: options
+ self assert: (options isKindOf: PPCCompilationOptions).
^ PPCConfiguration default
- arguments: arguments;
+ options: options;
compile: self
+
+ "Modified: / 24-08-2015 / 23:39:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!PPParser methodsFor:'*petitcompiler'!
-compile: arguments andParse: input
- ^ (self compile: arguments) parse: input
+compile: options andParse: input
+ ^ (self compile: options) parse: input
! !
!PPParser methodsFor:'*petitcompiler'!
compileAs: name
- | arguments |
- arguments := PPCArguments default.
- arguments name: name.
+ | options |
+ options := PPCCompilationOptions default.
+ options name: name.
- ^ self compile: arguments
+ ^ self compile: options
+
+ "Modified: / 24-08-2015 / 23:39:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!PPParser methodsFor:'*petitcompiler'!
@@ -648,7 +654,7 @@
map: aBlock
^ aBlock numArgs = self children size
ifTrue: [ PPMappedActionParser on: self block: aBlock ]
- ifFalse: [ self error: aBlock numArgs asString , ' arguments expected.' ]
+ ifFalse: [ self error: aBlock numArgs asString , ' options expected.' ]
"Modified: / 02-06-2015 / 17:16:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
--- a/compiler/libInit.cc Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/libInit.cc Mon Aug 24 23:42:53 2015 +0100
@@ -38,13 +38,13 @@
_PEGFsaStateInfo_Init(pass,__pRT__,snd);
_PEGFsaTransition_Init(pass,__pRT__,snd);
_PPCASTUtilities_Init(pass,__pRT__,snd);
-_PPCArguments_Init(pass,__pRT__,snd);
_PPCBridge_Init(pass,__pRT__,snd);
_PPCClass_Init(pass,__pRT__,snd);
_PPCClassBuilder_Init(pass,__pRT__,snd);
_PPCCodeBlock_Init(pass,__pRT__,snd);
_PPCCodeGen_Init(pass,__pRT__,snd);
_PPCCompilationError_Init(pass,__pRT__,snd);
+_PPCCompilationOptions_Init(pass,__pRT__,snd);
_PPCCompilationWarning_Init(pass,__pRT__,snd);
_PPCConfiguration_Init(pass,__pRT__,snd);
_PPCContext_Init(pass,__pRT__,snd);
--- a/compiler/stx_goodies_petitparser_compiler.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/stx_goodies_petitparser_compiler.st Mon Aug 24 23:42:53 2015 +0100
@@ -121,13 +121,13 @@
PEGFsaStateInfo
PEGFsaTransition
PPCASTUtilities
- PPCArguments
PPCBridge
PPCClass
PPCClassBuilder
PPCCodeBlock
PPCCodeGen
PPCCompilationError
+ PPCCompilationOptions
PPCCompilationWarning
PPCConfiguration
PPCContext
--- a/compiler/tests/PEGFsaScannerIntegrationTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/PEGFsaScannerIntegrationTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -643,7 +643,7 @@
fsa name: #nextToken.
codeGenerator := PPCScannerCodeGenerator new.
- codeGenerator arguments scannerSuperclass: PPCScanner.
+ codeGenerator options scannerSuperclass: PPCScanner.
scanner := codeGenerator
generateAndCompile: fsa.
--- a/compiler/tests/PPCCodeGeneratorTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/PPCCodeGeneratorTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -3,8 +3,7 @@
"{ NameSpace: Smalltalk }"
PPAbstractParserTest subclass:#PPCCodeGeneratorTest
- instanceVariableNames:'visitor node result compiler parser context configuration
- arguments'
+ instanceVariableNames:'visitor node result compiler parser context configuration options'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Visitors'
@@ -18,7 +17,7 @@
!
setUp
- arguments := PPCArguments default
+ options := PPCCompilationOptions default
profile: true;
codeGenerator: PPCCodeGenerator.
@@ -27,7 +26,9 @@
_self check.
_self generate.
].
- configuration arguments: arguments.
+ configuration options: options.
+
+ "Modified: / 24-08-2015 / 23:40:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
tearDown
@@ -925,7 +926,7 @@
!
testStarAnyNode
- arguments cacheFirstFollow: false.
+ options cacheFirstFollow: false.
node := PPCStarAnyNode new
child: PPCNilNode new;
yourself.
@@ -937,7 +938,7 @@
!
testStarCharSetPredicateNode
- arguments cacheFirstFollow: false.
+ options cacheFirstFollow: false.
node := PPCStarCharSetPredicateNode new
predicate: (PPCharSetPredicate on: [:e | e = $a ]);
child: PPCSentinelNode new;
@@ -954,7 +955,7 @@
!
testStarMessagePredicateNode
- arguments cacheFirstFollow: false.
+ options cacheFirstFollow: false.
node := PPCStarMessagePredicateNode new
message: #isLetter;
child: PPCSentinelNode new;
@@ -1032,8 +1033,8 @@
message: #isLetter;
child: PPCSentinelNode new;
yourself.
- arguments cacheFirstFollow: false.
- arguments guards: false.
+ options cacheFirstFollow: false.
+ options guards: false.
self compileTree: node.
self assert: parser class methodDictionary size = 1.
@@ -1057,7 +1058,7 @@
node := PPCForwardNode new
child: starNode;
yourself.
- arguments cacheFirstFollow: false.
+ options cacheFirstFollow: false.
self compileTree: node.
self assert: parser class methodDictionary size = 2.
@@ -1078,7 +1079,7 @@
node := PPCForwardNode new
child: starNode;
yourself.
- arguments cacheFirstFollow: false.
+ options cacheFirstFollow: false.
self compileTree: node.
self assert: parser class methodDictionary size = 1.
--- a/compiler/tests/PPCDistinctScannerTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/PPCDistinctScannerTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -59,7 +59,7 @@
| parser |
parser := self fooToken, self overlappingToken.
parser compileWithConfiguration: configuration.
- scanner := (Smalltalk at: configuration arguments scannerName) new.
+ scanner := (Smalltalk at: configuration options scannerName) new.
scanner stream: 'foobaz' asPetitStream.
scanner perform: #'consume_foo'.
@@ -73,7 +73,7 @@
| parser |
parser := self fooToken, self barToken.
parser compileWithConfiguration: configuration.
- scanner := (Smalltalk at: configuration arguments scannerName) new.
+ scanner := (Smalltalk at: configuration options scannerName) new.
scanner stream: 'foobar' asPetitStream.
scanner perform: #'consume_foo'.
@@ -88,7 +88,7 @@
parser := self aToken.
parser compileWithConfiguration: configuration.
- scanner := (Smalltalk at: configuration arguments scannerName) new.
+ scanner := (Smalltalk at: configuration options scannerName) new.
scanner stream: 'a' asPetitStream.
scanner perform: #'scan_token'.
@@ -103,7 +103,7 @@
parser := self fooToken.
parser compileWithConfiguration: configuration.
- scanner := (Smalltalk at: configuration arguments scannerName) new.
+ scanner := (Smalltalk at: configuration options scannerName) new.
scanner stream: 'foo' asPetitStream.
scanner perform: #'scan_foo'.
@@ -118,7 +118,7 @@
parser := self fooToken.
parser compileWithConfiguration: configuration.
- scanner := (Smalltalk at: configuration arguments scannerName) new.
+ scanner := (Smalltalk at: configuration options scannerName) new.
scanner stream: 'bar' asPetitStream.
scanner perform: #'scan_foo'.
@@ -133,7 +133,7 @@
parser := self fooToken, self idToken.
parser compileWithConfiguration: configuration.
- scanner := (Smalltalk at: configuration arguments scannerName) new.
+ scanner := (Smalltalk at: configuration options scannerName) new.
scanner stream: 'foothere' asPetitStream.
scanner perform: #'scan_foo'.
@@ -154,7 +154,7 @@
parser := self fooTrimmingToken, self idTrimmingToken.
parser compileWithConfiguration: configuration.
- scanner := (Smalltalk at: configuration arguments scannerName) new.
+ scanner := (Smalltalk at: configuration options scannerName) new.
scanner stream: 'foo there ' asPetitStream.
scanner perform: #'foo'.
@@ -182,7 +182,7 @@
parser := self fooToken, self idTrimmingToken.
parser compileWithConfiguration: configuration.
- scanner := (Smalltalk at: configuration arguments scannerName) new.
+ scanner := (Smalltalk at: configuration options scannerName) new.
scanner stream: 'foo there' asPetitStream.
scanner perform: #'foo'.
@@ -198,7 +198,7 @@
parser := self fooTrimmingToken, self idTrimmingToken.
parser compileWithConfiguration: configuration.
- scanner := (Smalltalk at: configuration arguments scannerName) new.
+ scanner := (Smalltalk at: configuration options scannerName) new.
scanner stream: 'foo there' asPetitStream.
scanner perform: #'scan_foo'.
@@ -213,7 +213,7 @@
parser := self fooTrimmingToken, self idTrimmingToken.
parser compileWithConfiguration: configuration.
- scanner := (Smalltalk at: configuration arguments scannerName) new.
+ scanner := (Smalltalk at: configuration options scannerName) new.
scanner stream: 'foo there' asPetitStream.
result := scanner perform: #'foo'.
--- a/compiler/tests/PPCLTokenizingOptimizationTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/PPCLTokenizingOptimizationTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -18,7 +18,7 @@
configuration
configuration := PPCTokenizingConfiguration new.
- configuration arguments generate: false.
+ configuration options generate: false.
^ configuration
!
--- a/compiler/tests/PPCNodeFirstFollowNextTests.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/PPCNodeFirstFollowNextTests.st Mon Aug 24 23:42:53 2015 +0100
@@ -25,7 +25,7 @@
setUp
configuration := PPCConfiguration default.
- configuration arguments generate: false.
+ configuration options generate: false.
! !
!PPCNodeFirstFollowNextTests methodsFor:'support'!
@@ -162,7 +162,7 @@
!
testFirstNegate1
- configuration arguments specialize: true.
+ configuration options specialize: true.
tree := self treeFrom: ('a' asParser negate, 'b' asParser).
first := self first: tree.
@@ -183,7 +183,7 @@
!
testFirstNot2
- configuration arguments specialize: true.
+ configuration options specialize: true.
tree := self treeFrom: (#letter asParser not star, #letter asParser).
first := self first: tree.
@@ -323,7 +323,7 @@
!
testFirstSequence6
- configuration arguments specialize: true.
+ configuration options specialize: true.
tree := self treeFrom: #space asParser star, 'a' asParser.
tree firstFollowCache: nil.
@@ -351,7 +351,7 @@
!
testFirstStarMessagePredicate2
- configuration arguments specialize: true.
+ configuration options specialize: true.
tree := self treeFrom: #space asParser star.
first := self first: tree.
@@ -364,7 +364,7 @@
!
testFirstTerminal
- configuration arguments specialize: true.
+ configuration options specialize: true.
tree := self treeFrom: 'a' asParser not.
first := self first: tree.
@@ -659,7 +659,7 @@
testFollowTrimmingToken
| token1 token2 |
- configuration arguments specialize: false.
+ configuration options specialize: false.
token1 := #letter asParser plus trimmingToken name: 'token1'; yourself.
token2 := #letter asParser plus trimmingToken name: 'token2'; yourself.
--- a/compiler/tests/PPCNodeTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/PPCNodeTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -148,7 +148,7 @@
setUp
configuration := PPCConfiguration default.
- configuration arguments generate: false.
+ configuration options generate: false.
!
treeFrom: parser
--- a/compiler/tests/PPCOptimizeChoicesTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/PPCOptimizeChoicesTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -16,20 +16,21 @@
!
setUp
- | arguments |
+ | options |
super setUp.
visitor := PPCOptimizeChoices new.
- arguments := PPCArguments default
+ options := PPCCompilationOptions default
profile: true.
configuration := PPCPluggableConfiguration on: [ :_self |
_self toPPCIr.
_self cacheFirstFollow.
].
- configuration arguments: arguments.
-
+ configuration options: options.
+
+ "Modified: / 24-08-2015 / 23:40:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
testHasCommonPrefix
--- a/compiler/tests/PPCOverlappingTokensTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/PPCOverlappingTokensTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -3,8 +3,8 @@
"{ NameSpace: Smalltalk }"
PPAbstractParserTest subclass:#PPCOverlappingTokensTest
- instanceVariableNames:'parser result context node arguments configuration fooToken
- idToken keywordToken p unaryToken assignmentToken'
+ instanceVariableNames:'parser result context node options configuration fooToken idToken
+ keywordToken p unaryToken assignmentToken'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Core-Tokenizing'
@@ -22,12 +22,12 @@
cleanClass
| parserClass scannerClass |
- parserClass := (Smalltalk at: arguments parserName ifAbsent: [nil]).
+ parserClass := (Smalltalk at: options parserName ifAbsent: [nil]).
parserClass notNil ifTrue:[
parserClass removeFromSystem
].
- scannerClass := (Smalltalk at: arguments scannerName ifAbsent: [nil]).
+ scannerClass := (Smalltalk at: options scannerName ifAbsent: [nil]).
scannerClass notNil ifTrue:[
scannerClass removeFromSystem
].
@@ -42,12 +42,12 @@
!
setUp
- arguments := PPCArguments default
+ options := PPCCompilationOptions default
profile: true;
yourself.
configuration := PPCTokenizingConfiguration new
- arguments: arguments;
+ options: options;
yourself.
self cleanClass.
@@ -56,7 +56,9 @@
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.
+ assignmentToken := (':=' asParser) token trim name: 'assignment'; yourself.
+
+ "Modified: / 24-08-2015 / 23:40:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
tearDown
--- a/compiler/tests/PPCTokenizingCodeGeneratorTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/PPCTokenizingCodeGeneratorTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
PPAbstractParserTest subclass:#PPCTokenizingCodeGeneratorTest
- instanceVariableNames:'visitor node result compiler parser context arguments tokenizer
+ instanceVariableNames:'visitor node result compiler parser context options tokenizer
whitespace configuration'
classVariableNames:''
poolDictionaries:''
@@ -14,12 +14,12 @@
cleanClass
| parserClass scannerClass |
- parserClass := (Smalltalk at: arguments parserName ifAbsent: [nil]).
+ parserClass := (Smalltalk at: options parserName ifAbsent: [nil]).
parserClass notNil ifTrue:[
parserClass removeFromSystem
].
- scannerClass := (Smalltalk at: arguments scannerName ifAbsent: [nil]).
+ scannerClass := (Smalltalk at: options scannerName ifAbsent: [nil]).
scannerClass notNil ifTrue:[
scannerClass removeFromSystem
].
@@ -35,9 +35,9 @@
!
setUp
- arguments := PPCArguments default
+ options := PPCCompilationOptions default
profile: true;
- yourself.
+ yourself.
self cleanClass.
@@ -47,12 +47,14 @@
_self unmarkConsumeTokensForInline.
_self createFSAs.
_self buildScannerTokens.
- _self buildScannerScans.
+ _self buildScannerScans.
_self generateScanner.
_self generateParser.
] base: PPCConfiguration tokenizing.
- configuration arguments: arguments.
+ configuration options: options.
+
+ "Modified: / 24-08-2015 / 23:40:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
tearDown
--- a/compiler/tests/PPCTokenizingTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/PPCTokenizingTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -4,7 +4,7 @@
PPAbstractParserTest subclass:#PPCTokenizingTest
instanceVariableNames:'parser result context node compiler id node2 id2 id1 node1 node3
- arguments configuration'
+ options configuration'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Core-Tokenizing'
@@ -22,12 +22,12 @@
cleanClass
| parserClass scannerClass |
- parserClass := (Smalltalk at: arguments parserName ifAbsent: [nil]).
+ parserClass := (Smalltalk at: options parserName ifAbsent: [nil]).
parserClass notNil ifTrue:[
parserClass removeFromSystem
].
- scannerClass := (Smalltalk at: arguments scannerName ifAbsent: [nil]).
+ scannerClass := (Smalltalk at: options scannerName ifAbsent: [nil]).
scannerClass notNil ifTrue:[
scannerClass removeFromSystem
].
@@ -44,15 +44,17 @@
!
setUp
- arguments := PPCArguments default
+ options := PPCCompilationOptions default
profile: true;
yourself.
configuration := PPCTokenizingConfiguration new
- arguments: arguments;
+ options: options;
yourself.
self cleanClass.
+
+ "Modified: / 24-08-2015 / 23:40:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
tearDown
@@ -336,17 +338,17 @@
!
testCompileTokenComplex2
- | a b argumentsWith |
+ | a b optionsWith |
"based on the PPSmalltlakGrammar>>blockArgumentsWith"
a := $| asParser smalltalkToken
yourself.
b := $] asParser smalltalkToken
yourself.
- argumentsWith := (a / b and ==> [:t | ]) wrapped
- name: 'argumentsWith';
+ optionsWith := (a / b and ==> [:t | ]) wrapped
+ name: 'optionsWith';
yourself.
- parser := argumentsWith compileWithConfiguration: configuration.
+ parser := optionsWith compileWithConfiguration: configuration.
self assert: parser parse: '|'.
self assert: parser parse: ']' end: 0.
@@ -481,7 +483,7 @@
testWhitespace
| token ws trimmingToken |
- configuration arguments inline: false.
+ configuration options inline: false.
token := 'foo' asParser token.
ws := #blank asParser star name: 'consumeWhitespace'; yourself.
@@ -500,7 +502,7 @@
testWhitespace2
| token ws trimmingToken |
- configuration arguments inline: false.
+ configuration options inline: false.
token := 'foo' asParser token.
ws := #blank asParser star name: 'consumeWhitespace'; yourself.
@@ -520,7 +522,7 @@
testWhitespace3
| token ws trimmingToken |
- configuration arguments inline: false.
+ configuration options inline: false.
token := 'foo' asParser token.
ws := #blank asParser star name: 'consumeWhitespace'; yourself.
--- a/compiler/tests/PPCUnivarsalGuardTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/PPCUnivarsalGuardTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -4,12 +4,13 @@
PPAbstractParserTest subclass:#PPCUnivarsalGuardTest
instanceVariableNames:'parser result context node compiler id node2 id2 id1 node1 node3
- arguments configuration'
+ options configuration'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Core-Universal'
!
+
!PPCUnivarsalGuardTest methodsFor:'as yet unclassified'!
assert: p parse: whatever
@@ -21,13 +22,15 @@
!
setUp
- arguments := PPCArguments default
+ options := PPCCompilationOptions default
profile: true;
yourself.
configuration := PPCUniversalConfiguration new
- arguments: arguments;
+ options: options;
yourself.
+
+ "Modified: / 24-08-2015 / 23:40:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
tearDown
@@ -113,3 +116,10 @@
self assert: parser parse: ' ab'.
! !
+!PPCUnivarsalGuardTest class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/tests/PPCUniversalOptimizationTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/PPCUniversalOptimizationTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -23,7 +23,7 @@
super setUp.
configuration := PPCUniversalConfiguration new.
- configuration arguments generate: false.
+ configuration options generate: false.
" ^ configuration := PPCPluggableConfiguration on:
[ :_self |
--- a/compiler/tests/PPCUniversalTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/PPCUniversalTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -4,7 +4,7 @@
PPAbstractParserTest subclass:#PPCUniversalTest
instanceVariableNames:'parser result context node compiler id node2 id2 id1 node1 node3
- arguments configuration'
+ options configuration'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Tests-Core-Universal'
@@ -30,7 +30,7 @@
tearDown
| parserClass |
- parserClass := (Smalltalk at: arguments parserName ifAbsent: [nil]).
+ parserClass := (Smalltalk at: options parserName ifAbsent: [nil]).
parserClass notNil ifTrue:[
"parserClass removeFromSystem"
].
@@ -569,14 +569,16 @@
!PPCUniversalTest methodsFor:'tests - ids'!
setUp
- arguments := PPCArguments default
+ options := PPCCompilationOptions default
profile: true;
debug: true;
yourself.
configuration := PPCUniversalConfiguration new
- arguments: arguments;
+ options: options;
yourself.
+
+ "Modified: / 24-08-2015 / 23:40:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!PPCUniversalTest class methodsFor:'documentation'!
--- a/compiler/tests/extras/PPCAbstractParserTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/extras/PPCAbstractParserTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -102,8 +102,8 @@
| time configuration |
configuration := self compilerConfiguration.
- configuration arguments parserName: self compiledParserClassName.
- configuration arguments scannerName: self compiledScannerClassName.
+ configuration options parserName: self compiledParserClassName.
+ configuration options scannerName: self compiledScannerClassName.
time := Time millisecondsToRun: [
self petitParser compileWithConfiguration: configuration.
].
--- a/compiler/tests/extras/PPCCompositeParserTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/extras/PPCCompositeParserTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -171,7 +171,7 @@
| time configuration |
configuration := self compilerConfiguration.
- configuration arguments parserName: self compiledParserClassName.
+ configuration options parserName: self compiledParserClassName.
time := Time millisecondsToRun: [
self petitParser compileWithConfiguration: configuration.
].
--- a/compiler/tests/extras/PPCExpressionGrammarTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/extras/PPCExpressionGrammarTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -89,7 +89,7 @@
| time configuration |
configuration := self compilerConfiguration.
- configuration arguments parserName: self compiledParserClassName.
+ configuration options parserName: self compiledParserClassName.
time := Time millisecondsToRun: [
self petitParser compileWithConfiguration: configuration.
].
--- a/compiler/tests/extras/PPCLL1ExpressionGrammarTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/extras/PPCLL1ExpressionGrammarTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -89,7 +89,7 @@
| time configuration |
configuration := self compilerConfiguration.
- configuration arguments parserName: self compiledParserClassName.
+ configuration options parserName: self compiledParserClassName.
time := Time millisecondsToRun: [
self petitParser compileWithConfiguration: configuration.
].
--- a/compiler/tests/extras/PPCLRPCompiledParserSmokeTest.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/extras/PPCLRPCompiledParserSmokeTest.st Mon Aug 24 23:42:53 2015 +0100
@@ -85,7 +85,7 @@
| time configuration |
configuration := self compilerConfiguration.
- configuration arguments parserName: self compiledParserClassName.
+ configuration options parserName: self compiledParserClassName.
time := Time millisecondsToRun: [
self petitParser compileWithConfiguration: configuration.
].
--- a/compiler/tests/extras/PPCLRPErrorNode.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/extras/PPCLRPErrorNode.st Mon Aug 24 23:42:53 2015 +0100
@@ -9,6 +9,7 @@
category:'PetitCompiler-Extras-Tests-LRP'
!
+
!PPCLRPErrorNode methodsFor:'error handing'!
onErrorNode: aBlock parser: aLRPParser
@@ -28,3 +29,10 @@
aLRPNodeVisitor visitErrorNode: self.
! !
+!PPCLRPErrorNode class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/tests/extras/PPCLRPParser.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/extras/PPCLRPParser.st Mon Aug 24 23:42:53 2015 +0100
@@ -60,7 +60,7 @@
].
compiled := (self methodizeBlock: aBlockNode withArguments: keys) compiledMethod.
- retval := compiled valueWithReceiver: Object new arguments: {aDictionary}.
+ retval := compiled valueWithReceiver: Object new options: {aDictionary}.
^retval.
!
--- a/compiler/tests/extras/PPCSmalltalkGrammarTests.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/extras/PPCSmalltalkGrammarTests.st Mon Aug 24 23:42:53 2015 +0100
@@ -95,8 +95,8 @@
| time configuration |
configuration := self compilerConfiguration.
- configuration arguments parserName: self compiledParserClassName.
- configuration arguments scannerName: self compiledScannerClassName.
+ configuration options parserName: self compiledParserClassName.
+ configuration options scannerName: self compiledScannerClassName.
time := Time millisecondsToRun: [
self petitParser compileWithConfiguration: configuration.
--- a/compiler/tests/extras/PPCSmalltalkParserTests.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/extras/PPCSmalltalkParserTests.st Mon Aug 24 23:42:53 2015 +0100
@@ -95,8 +95,8 @@
| time configuration |
configuration := self compilerConfiguration.
- configuration arguments parserName: self compiledParserClassName.
- configuration arguments scannerName: self compiledScannerClassName.
+ configuration options parserName: self compiledParserClassName.
+ configuration options scannerName: self compiledScannerClassName.
time := Time millisecondsToRun: [
self petitParser compileWithConfiguration: configuration.
--- a/compiler/tests/extras/PPCSmalltalkTests.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/extras/PPCSmalltalkTests.st Mon Aug 24 23:42:53 2015 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
TestCase subclass:#PPCSmalltalkTests
- instanceVariableNames:'configuration arguments result'
+ instanceVariableNames:'configuration options result'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Extras-Tests-Smalltalk'
@@ -17,12 +17,12 @@
!
setUp
- arguments := PPCArguments default
+ options := PPCArguments default
profile: true;
yourself.
configuration := PPCTokenizingConfiguration new
- arguments: arguments;
+ options: options;
yourself.
!
--- a/compiler/tests/extras/PPCompiledJavaResource.st Mon Aug 24 22:32:15 2015 +0100
+++ b/compiler/tests/extras/PPCompiledJavaResource.st Mon Aug 24 23:42:53 2015 +0100
@@ -15,7 +15,7 @@
| time configuration |
configuration := PPCConfiguration universal.
- configuration arguments parserName:#PPCompiledJavaSyntax.
+ configuration options parserName:#PPCompiledJavaSyntax.
time := Time millisecondsToRun: [
PPJavaSyntax new compileWithConfiguration: configuration.