compiler/PPCNotCharSetPredicateNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 03 Nov 2014 11:30:59 +0000
changeset 407 a0e6299c7337
parent 396 ec569977267a
child 414 0eaf09920532
permissions -rw-r--r--
Removed unused / obsolete methods from PPToken * remove PPToken class>>on:start:stop * remove PPToken>>initializeOn:start:stop

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

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.
!

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

!PPCNotCharSetPredicateNode class methodsFor:'documentation'!

version_HG

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