compiler/PPCTokenNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 10 May 2015 14:42:14 +0100
changeset 455 44208dab727c
parent 452 9f4558b3be66
child 515 b5316ef15274
permissions -rw-r--r--
Added .../parsers/java and .../compiler/tests/extras to exported .mczs

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

"{ NameSpace: Smalltalk }"

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

!PPCTokenNode methodsFor:'accessing'!

prefix
    ^ #token
!

tokenClass
    
    ^ tokenClass
!

tokenClass: anObject
    
    tokenClass := anObject
!

tokenType
    ^ self identityHash printString
! !

!PPCTokenNode methodsFor:'comparing'!

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

hash
    ^ super hash bitXor: tokenClass hash
! !

!PPCTokenNode methodsFor:'testing'!

isTokenNode
    ^ true
! !

!PPCTokenNode methodsFor:'visiting'!

accept: visitor
    ^ visitor visitTokenNode: self
! !