compiler/PPCCharSetPredicateNode.st
changeset 438 20598d7ce9fa
parent 422 116d2b2af905
child 452 9f4558b3be66
equal deleted inserted replaced
437:54b3bc9e3987 438:20598d7ce9fa
     9 	category:'PetitCompiler-Nodes'
     9 	category:'PetitCompiler-Nodes'
    10 !
    10 !
    11 
    11 
    12 !PPCCharSetPredicateNode methodsFor:'as yet unclassified'!
    12 !PPCCharSetPredicateNode methodsFor:'as yet unclassified'!
    13 
    13 
    14 asInlined
       
    15 	^ PPCInlineCharSetPredicateNode new
       
    16 		predicate: predicate;
       
    17 		name: name;
       
    18 		yourself
       
    19 !
       
    20 
       
    21 bodyOfPredicate: compiler
       
    22 	| classification classificationId |
       
    23 	classification := self extendClassification: predicate classification.
       
    24 	classificationId := compiler idFor: classification prefixed: #classification.
       
    25 	compiler addConstant: classification as: classificationId.
       
    26 	
       
    27 	compiler addOnLine: '(', classificationId, ' at: context peek asInteger)'.
       
    28 	compiler indent.
       
    29 	compiler add: 'ifFalse: [ self error: ''predicate not found'' ]'.
       
    30 	compiler add: 'ifTrue: [ context next ].'.
       
    31 	compiler dedent.
       
    32 !
       
    33 
       
    34 start: compiler id: id
    14 start: compiler id: id
    35 	compiler startMethod: id
    15 	compiler startMethod: id
    36 !
    16 !
    37 
    17 
    38 stop: compiler
    18 stop: compiler
    39 	^ compiler stopMethod
    19 	^ compiler stopMethod
    40 ! !
    20 ! !
    41 
    21 
       
    22 !PPCCharSetPredicateNode methodsFor:'visiting'!
       
    23 
       
    24 accept: visitor
       
    25 	^ visitor visitCharSetPredicateNode: self
       
    26 ! !
       
    27