• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to parse the java file  RSS feed

 
maa naa
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing a project
, I need produce a product to "watch" the changing of variable of program in sound, this way may assist novice programmer to debug. They can not only use eyes to watch the variable on Screen, but also can hear the changing of variable. it is obviously to reduce the workload of programmer.
I have produced two java classes. One is the class can play MIDI notes, another is quite easy that watch the changing of variable, but need a sentence insert into the target java source file, after the changing of the variable. for instance, in a bubble sort program, if I intend to watch the variable n(from 0 to 10), I must insert manually a watching sentence where the line after the n changes line. But I need let a program automaticly parse the target java file, and automaticly insert the watching sentence into the right place
my question is that how to parse the java file,and insert the sentence into the right place??
GIve me a CLue...
Thank You!!!
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you thinking that this should be done in an IDE? In which case a textListener similar to the ones that IDEs use to highlight various things, would work.
Or are you talking about doing this AFTER the class has been compiled?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!