compiler/PPCConfiguration.st
changeset 529 439c4057517f
parent 525 751532c8f3db
child 530 e36906742693
--- 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.
     ]
 ! !