PPListParser.st
changeset 169 cba3a51b9704
parent 56 e6c555201a3a
child 421 7e08b31e0dae
child 638 e41b42b3928f
equal deleted inserted replaced
168:9fa394e40830 169:cba3a51b9704
    18 	^ self withAll: (Array with: aFirstParser with: aSecondParser)
    18 	^ self withAll: (Array with: aFirstParser with: aSecondParser)
    19 !
    19 !
    20 
    20 
    21 withAll: aCollection
    21 withAll: aCollection
    22 	^ self basicNew setParsers: aCollection
    22 	^ self basicNew setParsers: aCollection
       
    23 ! !
       
    24 
       
    25 !PPListParser methodsFor:'*petitanalyzer-matching'!
       
    26 
       
    27 copyInContext: aDictionary seen: aSeenDictionary
       
    28 	| copy copies |
       
    29 	aSeenDictionary at: self ifPresent: [ :value | ^ value ].
       
    30 	copy := aSeenDictionary at: self put: self copy.
       
    31 	copies := OrderedCollection new.
       
    32 	parsers do: [ :each |
       
    33 		| result |
       
    34 		result := each 
       
    35 			copyInContext: aDictionary
       
    36 			seen: aSeenDictionary.
       
    37 		result isCollection
       
    38 			ifTrue: [ copies addAll: result ]
       
    39 			ifFalse: [ copies add: result ] ].
       
    40 	^ copy
       
    41 		setParsers: copies;
       
    42 		yourself
       
    43 ! !
       
    44 
       
    45 !PPListParser methodsFor:'*petitanalyzer-transforming'!
       
    46 
       
    47 replace: aParser with: anotherParser
       
    48 	super replace: aParser with: anotherParser.
       
    49 	parsers keysAndValuesDo: [ :index :parser |
       
    50 		parser == aParser
       
    51 			ifTrue: [ parsers at: index put: anotherParser ] ]
    23 ! !
    52 ! !
    24 
    53 
    25 !PPListParser methodsFor:'accessing'!
    54 !PPListParser methodsFor:'accessing'!
    26 
    55 
    27 children
    56 children
    51 ! !
    80 ! !
    52 
    81 
    53 !PPListParser class methodsFor:'documentation'!
    82 !PPListParser class methodsFor:'documentation'!
    54 
    83 
    55 version
    84 version
    56     ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPListParser.st,v 1.3 2012-05-04 22:10:13 vrany Exp $'
    85     ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPListParser.st,v 1.4 2014-03-04 14:32:58 cg Exp $'
    57 !
    86 !
    58 
    87 
    59 version_CVS
    88 version_CVS
    60     ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPListParser.st,v 1.3 2012-05-04 22:10:13 vrany Exp $'
    89     ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPListParser.st,v 1.4 2014-03-04 14:32:58 cg Exp $'
    61 !
    90 !
    62 
    91 
    63 version_SVN
    92 version_SVN
    64     ^ '§Id: PPListParser.st 2 2010-12-17 18:44:23Z vranyj1 §'
    93     ^ '$Id: PPListParser.st,v 1.4 2014-03-04 14:32:58 cg Exp $'
    65 ! !
    94 ! !
       
    95