compiler/PPCNotMessagePredicateNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 07 Nov 2014 02:14:26 +0000
changeset 417 3c0a91182e65
parent 414 0eaf09920532
child 421 7e08b31e0dae
permissions -rw-r--r--
Smalltalk grammar updated to allow for Smalltalk/X EOL comments

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

PPCAbstractPredicateNode subclass:#PPCNotMessagePredicateNode
	instanceVariableNames:'message'
	classVariableNames:''
	poolDictionaries:''
	category:'PetitCompiler-Nodes'
!

!PPCNotMessagePredicateNode methodsFor:'accessing'!

asInlined
	^ PPCInlineNotMessagePredicateNode new
		predicate: predicate;
		message: message;
		name: name;
		yourself
!

firstCharParser
	^ (PPPredicateObjectParser on: predicate message: 'predicate not expected') not.
!

firstCharSet
	PPCharSetPredicate on: [:e | (predicate value:e)  not ] 
!

message
	
	^ message
!

message: anObject
	
	message := anObject
! !

!PPCNotMessagePredicateNode methodsFor:'as yet unclassified'!

bodyOfPredicate: compiler
	compiler addOnLine: '(context peek ', message, ')'.
	compiler indent.
	compiler add: ' ifTrue: [ self error: '' predicate not expected'' ]'.
	compiler add: ' ifFalse: [ nil ].'.
	compiler dedent.
! !