compiler/tests/extras/PPCLRPAction.st
changeset 515 b5316ef15274
equal deleted inserted replaced
502:1e45d3c96ec5 515:b5316ef15274
       
     1 "{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }"
       
     2 
       
     3 "{ NameSpace: Smalltalk }"
       
     4 
       
     5 PPCLRPNode subclass:#PPCLRPAction
       
     6 	instanceVariableNames:'block textBlock interpretedBlock keywordEnd'
       
     7 	classVariableNames:''
       
     8 	poolDictionaries:''
       
     9 	category:'PetitCompiler-Extras-Tests-LRP'
       
    10 !
       
    11 
       
    12 !PPCLRPAction class methodsFor:'instance creation'!
       
    13 
       
    14 block: aBlock
       
    15     |retval|
       
    16     retval := self new.
       
    17     retval block: aBlock.
       
    18     retval textBlock: aBlock copy. 
       
    19     ^ retval
       
    20 ! !
       
    21 
       
    22 !PPCLRPAction methodsFor:'accessing'!
       
    23 
       
    24 block
       
    25     ^ block
       
    26 !
       
    27 
       
    28 block: anObject
       
    29     block := anObject
       
    30 !
       
    31 
       
    32 keywordEnd
       
    33     keywordEnd ifNil: [ self halt: 'Error in setting up range info for styling' ].
       
    34     ^ keywordEnd
       
    35 !
       
    36 
       
    37 keywordEnd: anObject
       
    38     keywordEnd := anObject
       
    39 !
       
    40 
       
    41 textBlock
       
    42     ^ textBlock
       
    43 !
       
    44 
       
    45 textBlock: anObject
       
    46     textBlock := anObject
       
    47 ! !
       
    48 
       
    49 !PPCLRPAction methodsFor:'printing'!
       
    50 
       
    51 printOn: aStream
       
    52 
       
    53     aStream nextPutAll: self class name.
       
    54     aStream nextPutAll: ' : '.
       
    55     aStream nextPutAll: self block asString.
       
    56 ! !
       
    57 
       
    58 !PPCLRPAction methodsFor:'visiting'!
       
    59 
       
    60 acceptVisitor: aLRPNodeVisitor
       
    61     aLRPNodeVisitor visitActionNode: self.
       
    62 ! !
       
    63