analyzer/extensions.st
changeset 381 0bbbcf5da2d4
parent 378 53d66ecfeb1b
child 382 1825151d6455
equal deleted inserted replaced
380:8fe3cb4e607f 381:0bbbcf5da2d4
   102 	"Iterate over all the named parse nodes of the receiver."
   102 	"Iterate over all the named parse nodes of the receiver."
   103 
   103 
   104 	self allParsersDo: [ :each | 
   104 	self allParsersDo: [ :each | 
   105 		each name notNil
   105 		each name notNil
   106 			ifTrue: [ aBlock value: each ] ]
   106 			ifTrue: [ aBlock value: each ] ]
   107 ! !
       
   108 
       
   109 !PPParser methodsFor:'*petitanalyzer-enumerating'!
       
   110 
       
   111 allParsers
       
   112 	"Answer all the parse nodes of the receiver."
       
   113 
       
   114 	| result |
       
   115 	result := OrderedCollection new.
       
   116 	self allParsersDo: [ :parser | result addLast: parser ].
       
   117 	^ result
       
   118 ! !
       
   119 
       
   120 !PPParser methodsFor:'*petitanalyzer-enumerating'!
       
   121 
       
   122 allParsersDo: aBlock
       
   123 	"Iterate over all the parse nodes of the receiver."
       
   124 
       
   125 	self allParsersDo: aBlock seen: IdentitySet new
       
   126 ! !
       
   127 
       
   128 !PPParser methodsFor:'*petitanalyzer-enumerating'!
       
   129 
       
   130 allParsersDo: aBlock seen: aSet
       
   131 	"Iterate over all the parse nodes of the receiver, do not visit and follow the ones contained in aSet."
       
   132 
       
   133 	(aSet includes: self)
       
   134 		ifTrue: [ ^ self ].
       
   135 	aSet add: self.
       
   136 	aBlock value: self.
       
   137 	self children
       
   138 		do: [ :each | each allParsersDo: aBlock seen: aSet ]
       
   139 ! !
   107 ! !
   140 
   108 
   141 !PPParser methodsFor:'*petitanalyzer-matching'!
   109 !PPParser methodsFor:'*petitanalyzer-matching'!
   142 
   110 
   143 copyInContext: aDictionary
   111 copyInContext: aDictionary