Re:Pure Java Typesetting System
by dangerlibrary on Monday January 23, 2023 @01:50PM
(#34493176)
This feels like something where the right solution is to drop down to the terminal and use the old standbys - sed/grep/find, etc. Could probably wrap it all up in `make` or `just` if this is something you do regularly.
[ Parent
| on HN ]
It's not trivial. Some class names are substrings of other classes. I'm pretty sure this requires loading and parsing the source code's AST to accomplish without breaking the build. The SO thread goes into more gnarly details.
Re:Pure Java Typesetting System
by dangerlibrary on Tuesday January 24, 2023 @01:03PM
(#34507381)
Sorry, I didn't mean to imply it was trivial, by any means. Just that there are powerful tools for "manipulating many line-delimited text files at once" and those tools seem likely to fit your goal.
It's possible you do in fact need to parse the AST for your goals - I haven't spent the requisite time to deeply understand the problem.