compiler/tests/PPCTokenizingCodeGeneratorTest.st
changeset 529 439c4057517f
parent 524 f6f68d32de73
child 534 a949c4fe44df
equal deleted inserted replaced
528:ebfddc82b8bb 529:439c4057517f
     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 PPAbstractParserTest subclass:#PPCTokenizingCodeGeneratorTest
     5 PPAbstractParserTest subclass:#PPCTokenizingCodeGeneratorTest
     6 	instanceVariableNames:'visitor node result compiler parser context arguments tokenizer
     6 	instanceVariableNames:'visitor node result compiler parser context options tokenizer
     7 		whitespace configuration'
     7 		whitespace configuration'
     8 	classVariableNames:''
     8 	classVariableNames:''
     9 	poolDictionaries:''
     9 	poolDictionaries:''
    10 	category:'PetitCompiler-Tests-Visitors'
    10 	category:'PetitCompiler-Tests-Visitors'
    11 !
    11 !
    12 
    12 
    13 !PPCTokenizingCodeGeneratorTest methodsFor:'setup'!
    13 !PPCTokenizingCodeGeneratorTest methodsFor:'setup'!
    14 
    14 
    15 cleanClass
    15 cleanClass
    16     | parserClass scannerClass |
    16     | parserClass scannerClass |
    17     parserClass := (Smalltalk at: arguments parserName ifAbsent: [nil]).
    17     parserClass := (Smalltalk at: options parserName ifAbsent: [nil]).
    18     parserClass notNil ifTrue:[ 
    18     parserClass notNil ifTrue:[ 
    19         parserClass removeFromSystem
    19         parserClass removeFromSystem
    20     ].
    20     ].
    21 
    21 
    22     scannerClass := (Smalltalk at: arguments scannerName ifAbsent: [nil]).
    22     scannerClass := (Smalltalk at: options scannerName ifAbsent: [nil]).
    23     scannerClass notNil ifTrue:[ 
    23     scannerClass notNil ifTrue:[ 
    24         scannerClass removeFromSystem
    24         scannerClass removeFromSystem
    25     ].
    25     ].
    26 !
    26 !
    27 
    27 
    33 context	
    33 context	
    34     ^ context := PPCProfilingContext new
    34     ^ context := PPCProfilingContext new
    35 !
    35 !
    36 
    36 
    37 setUp
    37 setUp
    38     arguments := PPCArguments default
    38     options := PPCCompilationOptions default
    39         profile: true;
    39         profile: true;
    40         yourself.	
    40         yourself.       
    41 
    41 
    42     self cleanClass.
    42     self cleanClass.
    43     
    43     
    44     configuration := PPCPluggableConfiguration on: [ :_self | 
    44     configuration := PPCPluggableConfiguration on: [ :_self | 
    45         _self cacheFirstFollow.
    45         _self cacheFirstFollow.
    46         _self buildParserClazz.
    46         _self buildParserClazz.
    47         _self unmarkConsumeTokensForInline.
    47         _self unmarkConsumeTokensForInline.
    48         _self createFSAs.
    48         _self createFSAs.
    49         _self buildScannerTokens.
    49         _self buildScannerTokens.
    50         _self buildScannerScans.	
    50         _self buildScannerScans.        
    51         _self generateScanner.
    51         _self generateScanner.
    52         _self generateParser.
    52         _self generateParser.
    53     ] base: PPCConfiguration tokenizing.
    53     ] base: PPCConfiguration tokenizing.
    54 
    54 
    55     configuration arguments: arguments.
    55     configuration options: options.
       
    56 
       
    57     "Modified: / 24-08-2015 / 23:40:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    56 !
    58 !
    57 
    59 
    58 tearDown
    60 tearDown
    59     "nothing to do now"
    61     "nothing to do now"
    60 ! !
    62 ! !