compiler/PPCStarNode.st
changeset 421 7e08b31e0dae
parent 392 9b297f0d949c
child 422 116d2b2af905
equal deleted inserted replaced
420:b2f2f15cef26 421:7e08b31e0dae
    24 rewrite: changeStatus
    24 rewrite: changeStatus
    25 	(child isKindOf: PPCMessagePredicateNode) ifTrue: [ 
    25 	(child isKindOf: PPCMessagePredicateNode) ifTrue: [ 
    26 		changeStatus change.
    26 		changeStatus change.
    27 		^ PPCStarMessagePredicateNode new
    27 		^ PPCStarMessagePredicateNode new
    28 			name: name;
    28 			name: name;
       
    29 			child: child;
    29 			message: child message;
    30 			message: child message;
    30 			yourself
    31 			yourself
    31 	]. 
    32 	]. 
    32 
    33 
    33 	(child isKindOf: PPCAnyNode) ifTrue: [ 
    34 	(child isKindOf: PPCAnyNode) ifTrue: [ 
    34 		changeStatus change.
    35 		changeStatus change.
    35 		^ PPCStarAnyNode new
    36 		^ PPCStarAnyNode new
    36 			name: name;
    37 			name: name;
       
    38 			child: child;
    37 			yourself
    39 			yourself
    38 	]. 
    40 	]. 
    39 
    41 
    40 	(child isKindOf: PPCCharSetPredicateNode) ifTrue: [ 
    42 	(child isKindOf: PPCCharSetPredicateNode) ifTrue: [ 
    41 		changeStatus change.
    43 		changeStatus change.
    42 		^ PPCStarCharSetPredicateNode new
    44 		^ PPCStarCharSetPredicateNode new
    43 			name: name;
    45 			name: name;
    44 			predicate: child predicate;
    46 			predicate: child predicate;
       
    47 			child: child;
    45 			yourself
    48 			yourself
    46 	] 
    49 	] 
       
    50 ! !
       
    51 
       
    52 !PPCStarNode methodsFor:'analyzing'!
       
    53 
       
    54 isNullable
       
    55 	^ true
    47 ! !
    56 ! !
    48 
    57 
    49 !PPCStarNode methodsFor:'as yet unclassified'!
    58 !PPCStarNode methodsFor:'as yet unclassified'!
    50 
    59 
    51 compileWith: compiler effect: effect id: id
    60 compileWith: compiler effect: effect id: id
    66 	compiler add: 'self clearError.'.
    75 	compiler add: 'self clearError.'.
    67 	compiler add: '^ retval asArray'.
    76 	compiler add: '^ retval asArray'.
    68  ^ compiler stopMethod.
    77  ^ compiler stopMethod.
    69 ! !
    78 ! !
    70 
    79 
       
    80 !PPCStarNode methodsFor:'first follow next'!
       
    81 
       
    82 followSets: aFollowDictionary firstSets: aFirstDictionary into: aSet suchThat: aBlock
       
    83 	| first |
       
    84 	super followSets: aFollowDictionary firstSets:  aFirstDictionary into: aSet suchThat: aBlock.
       
    85 	
       
    86 	first := aFirstDictionary at: self.
       
    87 	(aFollowDictionary at: child) addAll: (first reject: [:each | each isNullable])
       
    88 ! !
       
    89