Okay...
So, I'm doing an assignment for my
java class, and our teacher has written a halstead metrics program for us as a template.
We're to modify the program to apply to the java language, i.e. take a simple program and count all the different "verbs" and "nouns", then compute the halstead metrics for it.
The problem is recognizing symbols that do not have spaces surrounding them, i.e. args[], I need to count args, [, and ]. Now, is there anyway to write a file containing all the same information while putting spaces before and after such symbols... it's not implausable to write an if statement to find a [ and put spaces on either side.
But, because of how he's written the template using StringBuffer is going to be a massive amount of work and re-design of the template, which is to be avoided. And, replace() only works with characters... so... any ideas?
Thanks!