compiler/PPCUniversalConfiguration.st
changeset 531 dc3d13c2837d
parent 530 e36906742693
child 532 132d7898a2a1
--- a/compiler/PPCUniversalConfiguration.st	Tue Aug 25 01:30:32 2015 +0100
+++ b/compiler/PPCUniversalConfiguration.st	Wed Aug 26 21:41:20 2015 +0100
@@ -9,24 +9,9 @@
 	category:'PetitCompiler-Core'
 !
 
+
 !PPCUniversalConfiguration methodsFor:'compiling'!
 
-buildClass
-    |  builder |
-    self assert: (context parserClass isKindOf: PPCClass).
-    
-    builder := PPCClassBuilder new.
-    
-    builder compiledClassName: options parserName.
-    builder compiledSuperclass: PPCompiledParser.
-    builder methodDictionary: context parserClass methodDictionary.
-    builder constants: context parserClass constants.
-
-    ^ builder compileClass.
-
-    "Modified: / 25-08-2015 / 00:04:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 initialize
     super initialize.
 
@@ -46,30 +31,55 @@
     self generate.
 ! !
 
+!PPCUniversalConfiguration methodsFor:'error handling'!
+
+buildClass
+    | builder |
+
+    self assert:(context parserClass isKindOf:PPCClass).
+    builder := PPCClassBuilder new.
+    builder compiledClassName:context options parserName.
+    builder compiledSuperclass:PPCompiledParser.
+    builder methodDictionary:context parserClass methodDictionary.
+    builder constants:context parserClass constants.
+    ^ builder compileClass.
+
+    "Modified: / 25-08-2015 / 00:04:08 / Jan Vrany <jan.vrany@fit."
+    "Modified: / 26-08-2015 / 20:01:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+generate
+    | rootMethod  compiledParser |
+
+    context options generate ifFalse:[
+        ^ self
+    ].
+    rootMethod := (self codeGenerator)
+            options:context options;
+            clazz:context parserClass;
+            visit:ir.
+    compiledParser := self buildClass.
+    compiledParser startSymbol:rootMethod methodName.
+    compiledParser := compiledParser new.
+    ir := compiledParser.
+
+    "Modified: / 25-08-2015 / 00:03:46 / Jan Vrany <jan.vr"
+    "Modified: / 26-08-2015 / 20:00:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !PPCUniversalConfiguration methodsFor:'hooks'!
 
 codeGenerator
-    ^ PPCUniversalCodeGenerator new
-        options: options
+    ^ PPCUniversalCodeGenerator new options:context options
 ! !
 
-!PPCUniversalConfiguration methodsFor:'phases'!
+!PPCUniversalConfiguration class methodsFor:'documentation'!
 
-generate
-    | rootMethod compiledParser |
-    options generate ifFalse: [ ^ self ].
-    
-    rootMethod := self codeGenerator
-        options: options;
-        clazz: context parserClass;
-        visit: ir.
-    
-    compiledParser := self buildClass.
-    compiledParser startSymbol: rootMethod methodName.
-    compiledParser := compiledParser new.
-    
-    ir := compiledParser.
+version
+    ^ 'Path: stx/goodies/petitparser/compiler/PPCUniversalConfiguration.st, Version: 1.0, User: jv, Time: 2015-08-26T20:03:52.218+01'
+!
 
-    "Modified: / 25-08-2015 / 00:03:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+version_HG
+    ^ 'Path: stx/goodies/petitparser/compiler/PPCUniversalConfiguration.st, Version: 1.0, User: jv, Time: 2015-08-26T20:03:52.218+01'
 ! !