compiler/tests/PPCOptimizeChoicesTest.st
changeset 537 fb212e14d1f4
parent 535 a8feb0f47574
child 538 16e8536f5cfb
equal deleted inserted replaced
536:548996aca274 537:fb212e14d1f4
     1 "{ Package: 'stx:goodies/petitparser/compiler/tests' }"
     1 "{ Package: 'stx:goodies/petitparser/compiler/tests' }"
     2 
     2 
     3 "{ NameSpace: Smalltalk }"
     3 "{ NameSpace: Smalltalk }"
     4 
     4 
     5 TestCase subclass:#PPCOptimizeChoicesTest
     5 TestCase subclass:#PPCOptimizeChoicesTest
     6 	instanceVariableNames:'node result visitor configuration'
     6 	instanceVariableNames:'node result visitor compiler'
     7 	classVariableNames:''
     7 	classVariableNames:''
     8 	poolDictionaries:''
     8 	poolDictionaries:''
     9 	category:'PetitCompiler-Tests-Visitors'
     9 	category:'PetitCompiler-Tests-Visitors'
    10 !
    10 !
    11 
    11 
    12 !PPCOptimizeChoicesTest methodsFor:'as yet unclassified'!
    12 !PPCOptimizeChoicesTest methodsFor:'as yet unclassified'!
    13 
    13 
    14 asPPCTree: parser
    14 asPPCTree: parser
    15     ^ parser compileWithConfiguration: configuration
    15     ^ parser compileUsingCompiler: compiler
       
    16 
       
    17     "Modified: / 07-09-2015 / 10:08:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    16 !
    18 !
    17 
    19 
    18 setUp
    20 setUp
    19     | options |
    21     | options |
       
    22 
    20     super setUp.
    23     super setUp.
    21 
       
    22     visitor := PPCOptimizeChoices new.
    24     visitor := PPCOptimizeChoices new.
    23     
    25     options := (PPCCompilationOptions default)
    24     options := PPCCompilationOptions default
    26             profile:true;
    25                     profile: true;
    27             generate:false;
    26                     generate: false;
    28             tokenize:false;
    27                     tokenize: false;
    29             yourself.
    28                     yourself.
    30     compiler := PPCCompiler new.
    29                 
    31     compiler passes:{ PPCCacheFirstFollowPass }.
    30     configuration := PPCConfiguration new.
    32     compiler options:options.
    31     configuration passes: 
       
    32                         {
       
    33                             PPCCacheFirstFollowPass.
       
    34                         }.
       
    35     configuration options: options.
       
    36 
    33 
    37     "Modified: / 04-09-2015 / 16:21:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    34     "Modified: / 04-09-2015 / 16:21:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    38 !
    35 !
    39 
    36 
    40 testHasCommonPrefix
    37 testHasCommonPrefix