compiler/tests/extras/PPCExpressionGrammarTest.st
changeset 537 fb212e14d1f4
parent 529 439c4057517f
child 538 16e8536f5cfb
equal deleted inserted replaced
536:548996aca274 537:fb212e14d1f4
    38 compiledParserClassName
    38 compiledParserClassName
    39     "Return the name of the compiled parser"
    39     "Return the name of the compiled parser"
    40 
    40 
    41     ^ (self petitParserClass name , 'C_' , 
    41     ^ (self petitParserClass name , 'C_' , 
    42             "This is bit hacky!!"
    42             "This is bit hacky!!"
    43             ((self compilerConfiguration isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
    43             (("This is bit hacky!!" self compiler isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol
    44 
    44 
    45     "Created: / 29-07-2015 / 16:54:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    45     "Created: / 29-07-2015 / 16:54:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    46 !
    46 !
    47 
    47 
    48 compilerConfiguration
    48 compiler
    49     "Return configuration to use when compiling parser (as instance of PPCConfiguration)"
    49     "Return compiler to use when compiling parser (as instance of PPCConfiguration)"
    50 
    50     
    51     ^ self subclassResponsibility
    51     ^ self subclassResponsibility
    52 
    52 
    53     "Created: / 29-07-2015 / 16:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    53     "Created: / 29-07-2015 / 16:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    54 !
    54 !
    55 
    55 
    84 
    84 
    85 !PPCExpressionGrammarTest methodsFor:'setup & teardown'!
    85 !PPCExpressionGrammarTest methodsFor:'setup & teardown'!
    86 
    86 
    87 setUpBefore
    87 setUpBefore
    88     "Called before any of my tests is run (when resources are set up)"
    88     "Called before any of my tests is run (when resources are set up)"
    89     | time configuration |
    89     | time compiler |
    90 
    90 
    91     configuration := self compilerConfiguration.
    91     compiler := self compiler.
    92     configuration options parserName: self compiledParserClassName.
    92     compiler options parserName: self compiledParserClassName.
    93     time := Time millisecondsToRun: [
    93     time := Time millisecondsToRun: [
    94         self petitParser compileWithConfiguration: configuration.
    94         self petitParser compileUsingCompiler:compiler.
    95     ].
    95     ].
    96     Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr.
    96     Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr.
    97 
    97 
    98     "Created: / 29-07-2015 / 16:29:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    98     "Created: / 29-07-2015 / 16:29:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    99     "Modified: / 29-07-2015 / 18:40:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    99     "Modified: / 29-07-2015 / 18:40:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"