compiler/PPCPluggableNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 05 May 2015 15:07:56 +0200
changeset 450 914c2567c987
parent 438 20598d7ce9fa
child 452 9f4558b3be66
permissions -rw-r--r--
Oops, merged lost Smalltalk/X compatibility fixes

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

"{ NameSpace: Smalltalk }"

PPCNode subclass:#PPCPluggableNode
	instanceVariableNames:'block'
	classVariableNames:''
	poolDictionaries:''
	category:'PetitCompiler-Nodes'
!

!PPCPluggableNode methodsFor:'accessing'!

block
	
	^ block
!

block: anObject
	
	block := anObject
!

prefix
	^ #plug
! !

!PPCPluggableNode methodsFor:'analysis'!

acceptsEpsilon
	^ true
!

acceptsEpsilonOpenSet: set
	^ true
!

firstCharSet
	^ PPCharSetPredicate on: [:char | (block asParser parse: char asString) isPetitFailure not ]
! !

!PPCPluggableNode methodsFor:'comparing'!

= anotherNode
	super = anotherNode ifFalse: [ ^ false ].
	^ block = anotherNode block.
!

hash
	^ super hash bitXor: block hash
! !

!PPCPluggableNode methodsFor:'visiting'!

accept: visitor
	^ visitor visitPluggableNode: self
! !