据我所知,PetitParser用同名的生产方法初始化每个实例变量。例如,要添加自定义实例变量并在initialize方法中初始化它,应该做什么?
发布于 2013-03-22 16:44:16
您可以在子类中覆盖类端方法#ignoredNames,以添加您自己的实例变量,而PetitParser不涉及这些变量:
PPCompositeParser class>>#ignoredNames
"Answer a collection of instance-variables that should
not be automatically initialized with productions, but
that are used internal to the composite parser."
^ PPCompositeParser allInstVarNameshttps://stackoverflow.com/questions/15571855
复制相似问题