musiKk / plyj

A Java parser written in Python using PLY.
Other
150 stars 69 forks source link

Provide default implementation of accept method #26

Closed linzhp closed 10 years ago

linzhp commented 10 years ago

With the default implementation, the AST traversal is more thorough, and the code is shorter. Also, a leave method is added to the Visitor and called from accept method to give more power to the traversal

musiKk commented 10 years ago

Thanks a lot and sorry for taking so long. I hope there are no hidden bugs because visitors are essentially untested yet. I added a few minor tests to make sure there are no regressions and so far everything is fine.

I especially like the leave method.