analyzer/PPSearchRule.st
changeset 204 223004340c43
child 296 24d1270f78e0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/analyzer/PPSearchRule.st	Tue Mar 04 16:42:16 2014 +0100
@@ -0,0 +1,43 @@
+"{ Package: 'stx:goodies/petitparser/analyzer' }"
+
+PPRule subclass:#PPSearchRule
+	instanceVariableNames:'answerBlock'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'PetitAnalyzer-Core'
+!
+
+
+!PPSearchRule class methodsFor:'instance creation'!
+
+searchFor: aParser thenDo: aBlock
+	^ (self searchFor: aParser) setAnswerBlock: aBlock
+! !
+
+!PPSearchRule methodsFor:'initialization'!
+
+setAnswerBlock: aBlock
+	answerBlock := aBlock
+! !
+
+!PPSearchRule methodsFor:'matching'!
+
+canMatch: aParser
+	owner setAnswer: (answerBlock cull: aParser cull: owner answer).
+	^ super canMatch: aParser
+!
+
+foundMatchFor: aParser 
+	^ aParser
+! !
+
+!PPSearchRule class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/goodies/petitparser/analyzer/PPSearchRule.st,v 1.1 2014-03-04 15:42:16 cg Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/goodies/petitparser/analyzer/PPSearchRule.st,v 1.1 2014-03-04 15:42:16 cg Exp $'
+! !
+