congo-cc / congo-parser-generator

The CongoCC Parser Generator, the Next Generation of JavaCC 21, which in turn was the next generation of JavaCC
https://discuss.congocc.org/
Other
36 stars 11 forks source link

Refactor/decompose TreeBuildingAndRecovery macro #35

Closed adMartem closed 1 year ago

adMartem commented 1 year ago

One of the first things I had to do in my JTB experiments was to refactor the big macro for tree building so I could understand it and potentially suggest/make some changes as part of a potential "JTB_PARSE_TREE"-type setting. I now realize that I worry that my code to accomplish that is based on my refactored code, and that I couldn't be sure when I would be at a point to offer the code for such a setting to fellow Congolese, so this is a change that only reflects the refactoring without any of the work-in-progress regarding JTB. It is intended to change neither the behavior of the node building nor the functionality of the built nodes one iota. I believe that intent is met. I have not made corresponding changes to the Python or CSharp versions of this code (in part due to my lack of success the last time I tried that), but I am less worried (selfishly) about that since I doubt there is any value to providing a future JTB setting outside of Java. It is probably the case, however, that if this pull request is worthwhile, the parallel changes to the other language versions should probably be done eventually for maintainability. I you agree, I will, as a last resort, commit to try to make them eventually, but someone else could probably do them faster and more reliably. Whew, that said, here it is.