'From Pharo-1.0 of 19 October 2009 [Latest update: #10517] on 14 August 2010 at 6:04:51 pm'! "Change Set: PetitParser-asSymbol Date: 14 August 2010 Author: Holger Freyther use asSymbol instead of asString to increase portability."! !PPCompositeParser methodsFor: 'initialization' stamp: 'FirstnameLastname 8/14/2010 18:02'! initializeStartingAt: aSymbol | allVariableNames ignoredVariableNames productionIndexesAndNames | self initialize. "find all the productions that need to be initialized" allVariableNames := self class allInstVarNames. ignoredVariableNames := self class ignoredNames. productionIndexesAndNames := ((1 to: self class instSize) collect: [ :index | index -> (allVariableNames at: index) asSymbol ]) reject: [ :assoc | ignoredVariableNames includes: assoc value asSymbol ]. "initialize productions with an undefined parser to be replaced later" parser := PPUnresolvedParser named: aSymbol. productionIndexesAndNames do: [ :assoc | self instVarAt: assoc key put: (PPUnresolvedParser named: assoc value) ]. parser := self perform: aSymbol. "resolve unresolved parsers with their actual implementation" productionIndexesAndNames do: [ :assoc | (self respondsTo: assoc value) ifFalse: [ self error: 'Unable to initialize ' , assoc value printString ] ifTrue: [ (self instVarAt: assoc key) def: (self perform: assoc value) ] ]! !