compiler/PPCNotCharSetPredicateNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 15 Apr 2015 11:28:09 +0100
changeset 422 116d2b2af905
parent 414 0eaf09920532
child 438 20598d7ce9fa
permissions -rw-r--r--
To fold

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

"{ NameSpace: Smalltalk }"

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


!PPCNotCharSetPredicateNode methodsFor:'as yet unclassified'!

asInlined
	^ PPCInlineNotCharSetPredicateNode new
		predicate: predicate;
		name: name;
		yourself
!

bodyOfPredicate: compiler
	| classificationId  classification |
	classification := self extendClassification: predicate classification.
	classificationId := (compiler idFor: classification prefixed: #classification).
	compiler  addConstant: classification as: classificationId.
	
	compiler addOnLine: '(', classificationId, ' at: context peek asInteger)'.
	compiler indent.
	compiler add: ' ifTrue: [ self error: '' predicate not expected'' ]'.
	compiler add: ' ifFalse: [ nil ].'.
	compiler dedent.
!

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

!PPCNotCharSetPredicateNode class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
! !