compiler/tests/extras/PPCCompositeParserTest.st
changeset 537 fb212e14d1f4
parent 529 439c4057517f
child 538 16e8536f5cfb
equal deleted inserted replaced
536:548996aca274 537:fb212e14d1f4
   116 compiledParserClassName
   116 compiledParserClassName
   117     "Return the name of the compiled parser"
   117     "Return the name of the compiled parser"
   118 
   118 
   119     ^ (self petitParserClass name , 'C_' , 
   119     ^ (self petitParserClass name , 'C_' , 
   120             "This is bit hacky!!"
   120             "This is bit hacky!!"
   121             ((self compilerConfiguration isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
   121             (("This is bit hacky!!" self compiler isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
   122 
   122 
   123     "Created: / 29-07-2015 / 16:54:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   123     "Created: / 29-07-2015 / 16:54:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   124 !
   124 !
   125 
   125 
   126 compilerConfiguration
   126 compiler
   127     "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
   127     "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
   128 
   128     
   129     ^ self subclassResponsibility
   129     ^ self subclassResponsibility
   130 
   130 
   131     "Created: / 29-07-2015 / 16:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   131     "Created: / 29-07-2015 / 16:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   132 !
   132 !
   133 
   133 
   166 
   166 
   167 !PPCCompositeParserTest methodsFor:'setup & teardown'!
   167 !PPCCompositeParserTest methodsFor:'setup & teardown'!
   168 
   168 
   169 setUpBefore
   169 setUpBefore
   170     "Called before any of my tests is run (when resources are set up)"
   170     "Called before any of my tests is run (when resources are set up)"
   171     | time configuration |
   171     | time compiler |
   172 
   172 
   173     configuration := self compilerConfiguration.
   173     compiler := self compiler.
   174     configuration options parserName: self compiledParserClassName.
   174     compiler options parserName: self compiledParserClassName.
   175     time := Time millisecondsToRun: [
   175     time := Time millisecondsToRun: [
   176         self petitParser compileWithConfiguration: configuration.
   176         self petitParser compileUsingCompiler:compiler.
   177     ].
   177     ].
   178     Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr.
   178     Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr.
   179 
   179 
   180     "Created: / 29-07-2015 / 16:29:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   180     "Created: / 29-07-2015 / 16:29:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   181     "Modified: / 29-07-2015 / 18:40:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   181     "Modified: / 29-07-2015 / 18:40:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"