Merged JK's work on PetitCompiler
Name: PetitCompiler-JanKurs.57
Author: JanKurs
Time: 05-11-2014, 05:10:47 AM
UUID: 4c625efe-77fd-465d-bd63-72ead0b5d3ba
Name: PetitCompiler-Tests-JanVrany.13
Author: JanVrany
Time: 05-11-2014, 09:31:07 AM
UUID: 189ae287-6bc1-40ba-8458-b8392c4260a0
"{ Package: 'stx:goodies/petitparser/compiler' }"
PPCNode subclass:#PPCListNode
instanceVariableNames:'children'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Nodes'
!
!PPCListNode methodsFor:'accessing'!
children
^ children
!
children: anObject
children := anObject
! !
!PPCListNode methodsFor:'analysis'!
acceptsEpsilon
self subclassResponsibility
!
acceptsEpsilonOpenSet: set
self subclassResponsibility
!
replace: node with: anotherNode
children keysAndValuesDo: [ :index :child |
child == node ifTrue: [ children at: index put: anotherNode ]
]
! !
!PPCListNode methodsFor:'copying'!
postCopy
super postCopy.
children := children copy
! !
!PPCListNode methodsFor:'optimizing'!
inline: changeStatus
| inlinedNode |
self children do: [ :child |
inlinedNode := child asInlined.
(inlinedNode ~= child) ifTrue: [
changeStatus change.
^ self replace: child with: inlinedNode.
]
]
!
optimize: params status: changeStatus
| retval |
retval := self.
retval := retval rewrite: params status: changeStatus.
retval := retval inline: params status: changeStatus.
^ retval
! !
!PPCListNode class methodsFor:'documentation'!
version_HG
^ '$Changeset: <not expanded> $'
! !