compiler/PPCStarCharSetPredicateNode.st
changeset 464 f6d77fee9811
parent 452 9f4558b3be66
child 504 0fb1f0799fc1
child 515 b5316ef15274
equal deleted inserted replaced
459:4751c407bb40 464:f6d77fee9811
    42 
    42 
    43 hash
    43 hash
    44     ^ super hash bitXor: predicate hash
    44     ^ super hash bitXor: predicate hash
    45 ! !
    45 ! !
    46 
    46 
    47 !PPCStarCharSetPredicateNode methodsFor:'first follow next'!
       
    48 
       
    49 firstSets: aFirstDictionary into: aSet suchThat: aBlock
       
    50     "
       
    51         First and follow should be performed on the non-specialized tree, i.e. on a tree
       
    52         with star -> messageNode. Not on myself.
       
    53         
       
    54         The reason for that is, that:
       
    55         - I am terminal
       
    56         - I am nullable
       
    57         
       
    58         This means, I look like epsilon node for the first follow analysis. And epsilons 
       
    59         are ignored in sequences, thus sequence of StarMessagePredicate, Literal
       
    60         leads to { Literal } as firstSet and not expected { MessagePredicate, Literal }
       
    61     "
       
    62     ^ self error: 'Cannot perform first/follow analysis on myself, sorry for that :('
       
    63 ! !
       
    64 
       
    65 !PPCStarCharSetPredicateNode methodsFor:'visiting'!
    47 !PPCStarCharSetPredicateNode methodsFor:'visiting'!
    66 
    48 
    67 accept: visitor
    49 accept: visitor
    68     ^ visitor visitStarCharSetPredicateNode: self
    50     ^ visitor visitStarCharSetPredicateNode: self
    69 ! !
    51 ! !