analyzer/PPRule.st
author sr
Wed, 04 Jul 2018 15:30:19 +0200
changeset 611 38338f2de417
parent 292 294bc6d90b37
child 380 8fe3cb4e607f
permissions -rw-r--r--
build order was wrong

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

Object subclass:#PPRule
	instanceVariableNames:'owner search'
	classVariableNames:''
	poolDictionaries:''
	category:'PetitAnalyzer-Core'
!


!PPRule class methodsFor:'instance creation'!

new
	^ self basicNew initialize
!

searchFor: aParser
	^ self new setSearch: aParser
! !

!PPRule methodsFor:'initialization'!

initialize
!

setOwner: aGrammarSearcher
	owner := aGrammarSearcher
!

setSearch: aParser
	search := aParser
! !

!PPRule methodsFor:'matching'!

canMatch: aParser 
	^ true
!

foundMatchFor: aParser 
	self subclassResponsibility
!

performOn: aParser
	(search match: aParser inContext: owner context)
		ifFalse: [ ^ nil ].
	(self canMatch: aParser)
		ifFalse: [ ^ nil ].
	^ self foundMatchFor: aParser
! !

!PPRule class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/goodies/petitparser/analyzer/PPRule.st,v 1.2 2014-03-04 20:27:51 cg Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/goodies/petitparser/analyzer/PPRule.st,v 1.2 2014-03-04 20:27:51 cg Exp $'
! !