compiler/PPCTokenGuard.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 15 Jun 2015 18:00:44 +0100
changeset 487 602215b19135
parent 464 f6d77fee9811
permissions -rw-r--r--
Fix in codegen: fixed compilation of unknown node: do not hardcode return variable name ...use `self retvalVar` instead

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

"{ NameSpace: Smalltalk }"

Object subclass:#PPCTokenGuard
	instanceVariableNames:'node'
	classVariableNames:''
	poolDictionaries:''
	category:'PetitCompiler-Guards'
!

!PPCTokenGuard class methodsFor:'as yet unclassified'!

on: node
    ^ self new
        node: node;
        yourself
! !

!PPCTokenGuard methodsFor:'as yet unclassified'!

firstToken
    self assert: node firstSetWithTokens  size = 1.
    ^ node firstSetWithTokens anyOne
!

makesSense
    ^ node firstSetWithTokens size = 1 and: [ node firstSetWithTokens anyOne isTokenNode ]
!

node
    ^ node
!

node: aPPCNode
    node := aPPCNode
! !