compiler/PPCAndNode.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:#PPCAndNode
       
     4 	instanceVariableNames:''
       
     5 	classVariableNames:''
       
     6 	poolDictionaries:''
       
     7 	category:'PetitCompiler-Nodes'
       
     8 !
       
     9 
       
    10 PPCAndNode comment:''
       
    11 !
       
    12 
       
    13 !PPCAndNode methodsFor:'as yet unclassified'!
       
    14 
       
    15 compileWith: compiler effect: effect id: id
       
    16 
       
    17 	compiler startMethod: id.
       
    18 	compiler addVariable: 'memento'.
       
    19 	compiler addVariable: 'retval'.
       
    20 	compiler add: (compiler smartRemember: child).
       
    21 	
       
    22 	compiler add: 'retval :='.
       
    23 	compiler callOnLine: (child compileWith: compiler).
       
    24 	compiler add: (compiler smartRestore: child).
       
    25 
       
    26 	compiler add: '^ retval'.
       
    27  ^ compiler stopMethod.
       
    28 !
       
    29 
       
    30 prefix
       
    31 	^ #and
       
    32 ! !
       
    33