compiler/PPCForwardNode.st
changeset 391 553a5456963b
child 392 9b297f0d949c
equal deleted inserted replaced
390:17ba167b8ee1 391:553a5456963b
       
     1 "{ Package: 'stx:goodies/petitparser/compiler' }"
       
     2 
       
     3 PPCDelegateNode subclass:#PPCForwardNode
       
     4 	instanceVariableNames:'block'
       
     5 	classVariableNames:''
       
     6 	poolDictionaries:''
       
     7 	category:'PetitCompiler-Nodes'
       
     8 !
       
     9 
       
    10 PPCForwardNode comment:''
       
    11 !
       
    12 
       
    13 !PPCForwardNode methodsFor:'compiling'!
       
    14 
       
    15 check
       
    16 	^ (child name = self name and: [child suffix = self suffix]) ifTrue: [ 'referring to itself!!' ]
       
    17 !
       
    18 
       
    19 compileWith: compiler effect: effect id: id
       
    20 	compiler startMethod: id.
       
    21 	compiler add: '^ '.
       
    22 	"child name = 'keyword' ifTrue: [ self halt ]."
       
    23 	compiler callOnLine: (child compileWith: compiler).
       
    24  ^ compiler stopMethod.	
       
    25 !
       
    26 
       
    27 prefix
       
    28 	^ #fw
       
    29 !
       
    30 
       
    31 rewrite: changeStatus
       
    32 	child name ifNil: [  
       
    33 		changeStatus change.
       
    34 		child name: self name.
       
    35 		^ child
       
    36 	].
       
    37 
       
    38 	(child name = self name) ifTrue: [ 
       
    39 		changeStatus change.
       
    40 		^ child
       
    41 	]
       
    42 ! !
       
    43