analyzer/PPParserReplaceRule.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 04 Oct 2014 21:26:15 +0100
changeset 381 0bbbcf5da2d4
parent 378 53d66ecfeb1b
permissions -rw-r--r--
`PPParser>>allParsers`, `allParsersDo:(seen:)` moved to base PetitParser package. The method #allParsersDo: is actually used used by PPContext>>initializeFor: therefore it has to be in the package stx:goodies/petitparser (MC package PetitParser) and _NOT_ in stx:goodies/petitparser/analyzer (MC package PetitAnalyzer)

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

PPReplaceRule subclass:#PPParserReplaceRule
	instanceVariableNames:'replaceParser'
	classVariableNames:''
	poolDictionaries:''
	category:'PetitAnalyzer-Core'
!


!PPParserReplaceRule class methodsFor:'instance creation'!

searchFor: aSearchParser replaceWith: aReplaceParser when: aVerificationBlock
	^ (self searchFor: aSearchParser) 
		setReplaceParser: aReplaceParser;
		setVerificationBlock: aVerificationBlock;
		yourself
! !

!PPParserReplaceRule methodsFor:'initialization'!

setReplaceParser: aParser
	replaceParser := aParser
! !

!PPParserReplaceRule methodsFor:'matching'!

foundMatchFor: aParser 
	^ replaceParser copyInContext: owner context
! !

!PPParserReplaceRule class methodsFor:'documentation'!

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

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

version_HG

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