compiler/PPCStarNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 10 Sep 2015 07:13:16 +0100
changeset 547 0b8c75af51a0
parent 515 b5316ef15274
permissions -rw-r--r--
Portability: Removed tests/asserts referring to BlockClosure Due to historical reasons, there's no BlockClosure in Smalltalk/X, the class is named Block. Conversely, there's no Block in Squeak/Pharo.

"{ Package: 'stx:goodies/petitparser/compiler' }"

"{ NameSpace: Smalltalk }"

PPCDelegateNode subclass:#PPCStarNode
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'PetitCompiler-Nodes'
!

!PPCStarNode methodsFor:'accessing'!

acceptsEpsilon
    ^ true
!

acceptsEpsilonOpenSet: set
    ^ true
!

defaultName
    ^ #star
! !

!PPCStarNode methodsFor:'analysis'!

isNullable
    ^ true
!

recognizedSentencesPrim
    ^ 	#()
! !

!PPCStarNode methodsFor:'first follow next'!

followSets: aFollowDictionary firstSets: aFirstDictionary into: aSet suchThat: aBlock
    | first |
    super followSets: aFollowDictionary firstSets:  aFirstDictionary into: aSet suchThat: aBlock.
    
    first := aFirstDictionary at: self.

    self children do: [ :el | 
        (aFollowDictionary at: el) addAll: (first reject: [:each | each isNullable])
    ]
! !

!PPCStarNode methodsFor:'visiting'!

accept: visitor
    ^ visitor visitStarNode: self
! !