Hi. I'm starting to need to parse Java code, and am going to be using the PetitJava as found on SmalltalkHub. In particular, I need access to the AST from this parsing.
So, I am going to be filling in the AST generation that is found there to cover more of the parsed syntax, following along the lines already laid out there.
A question I have, though, is why none of our AST models seems to print out the 'code' by default? This model, and I believe the RB Smalltalk AST, neither have a printOn: defined, so that when you inspect/explore the results, it is rather unpleasant to find out what the model is of. In some past models, I have included a default #printOn: to the model parts,so that when exploring the parsed results, it is easier to see which parts of the code you are looking at. (Most recently while delving into a 10,000+ line COBOL program). Personally, I find it much more enjoyable.
Is there a reason to not do this? I am already adding this to the PetitJava code as it makes it easier to see what I'm doing, but I can package it independently if anyone objects.
-Chris