compiler/PPCAbstractPredicateNode.st
changeset 422 116d2b2af905
parent 421 7e08b31e0dae
child 438 20598d7ce9fa
equal deleted inserted replaced
421:7e08b31e0dae 422:116d2b2af905
     1 "{ Package: 'stx:goodies/petitparser/compiler' }"
     1 "{ Package: 'stx:goodies/petitparser/compiler' }"
       
     2 
       
     3 "{ NameSpace: Smalltalk }"
     2 
     4 
     3 PPCNode subclass:#PPCAbstractPredicateNode
     5 PPCNode subclass:#PPCAbstractPredicateNode
     4 	instanceVariableNames:'predicate'
     6 	instanceVariableNames:'predicate'
     5 	classVariableNames:''
     7 	classVariableNames:''
     6 	poolDictionaries:''
     8 	poolDictionaries:''
     7 	category:'PetitCompiler-Nodes'
     9 	category:'PetitCompiler-Nodes'
     8 !
    10 !
     9 
       
    10 !PPCAbstractPredicateNode class methodsFor:'instance creation'!
       
    11 
       
    12 new
       
    13     "return an initialized instance"
       
    14 
       
    15     ^ self basicNew initialize.
       
    16 ! !
       
    17 
    11 
    18 !PPCAbstractPredicateNode methodsFor:'accessing'!
    12 !PPCAbstractPredicateNode methodsFor:'accessing'!
    19 
    13 
    20 predicate
    14 predicate
    21 	
    15 	
    33 
    27 
    34 !PPCAbstractPredicateNode methodsFor:'analysis'!
    28 !PPCAbstractPredicateNode methodsFor:'analysis'!
    35 
    29 
    36 acceptsEpsilon
    30 acceptsEpsilon
    37 	^ false
    31 	^ false
    38 !
       
    39 
       
    40 firstCharParser
       
    41 	^ PPPredicateObjectParser on: predicate message: 'predicate expected'.
       
    42 !
    32 !
    43 
    33 
    44 firstCharSet
    34 firstCharSet
    45 	^ PPCharSetPredicate on: predicate
    35 	^ PPCharSetPredicate on: predicate
    46 ! !
    36 ! !
    81 
    71 
    82 !PPCAbstractPredicateNode methodsFor:'optimizing'!
    72 !PPCAbstractPredicateNode methodsFor:'optimizing'!
    83 
    73 
    84 asInlined
    74 asInlined
    85 	^ super asInlined
    75 	^ super asInlined
    86 !
       
    87 
       
    88 optimize: params status: changeStatus
       
    89 	| retval |
       
    90 	retval := self.
       
    91 	retval := retval rewrite: params status: changeStatus.
       
    92 	retval := retval inline: params status: changeStatus.
       
    93 	
       
    94 	^ retval
       
    95 ! !
    76 ! !
    96 
    77