How to start a Java parser
Hi all,
Am new to the java world and I wanted to know if there is a parser provided by Java to extract certain piece of information in the code. What I want to do is to give the parser any piece of code and it should be able to read it, find the loops and Boolean expression and be able to change them according to certain rules provided in advance. Is there a way that I can start with??
Thanks in advance
Re: How to start a Java parser
Are you are asking about how to edit the text files containing source code?
Re: How to start a Java parser
Well I want the parser to read and change then save it to another source file. It needs to change only certain parts like I mentioned above. Thanks for the quick reply.
Re: How to start a Java parser
I would suggest some reading from the String class and the Scanner class. Also get a specific idea of what will be changed. Keep the requirements in mind as you look the classes over and even take notes on what methods might be available. Try to organize a plan from there. Note that you may not find everything you need in the classes, but this should get you a starting point. Plenty of room for questions here. Good luck
Re: How to start a Java parser
Thanks a lot. I will go through the mentioned classes and will see how it goes. By default Java doesn't have a parser right??
Re: How to start a Java parser
By parser you mean some code that converts syntax to semantics?
I have not seen anything in the java SE classes that does that.
Re: How to start a Java parser
Quote:
Originally Posted by
Sharmeen
By default Java doesn't have a parser right??
Surely a language like Java is well documented. What does your favorite search engine find?
Re: How to start a Java parser
Quote:
Originally Posted by
Norm
By parser you mean some code that converts syntax to semantics?
I have not seen anything in the java SE classes that does that.
Well something like that with my own rules.
Re: How to start a Java parser
Quote:
Originally Posted by
jps
Surely a language like Java is well documented. What does your favorite search engine find?
Well it told me that it doesn't and it gave me other options to be used like ANTLR which I don't want to go through.
Re: How to start a Java parser
Quote:
Originally Posted by
Sharmeen
Well something like that with my own rules.
Take a moment from this question and do some of the posted reading. Once you see what is available, ask any questions you have left.
Good luck with the research
Re: How to start a Java parser
Quote:
Originally Posted by
jps
Take a moment from this question and do some of the posted reading. Once you see what is available, ask any questions you have left.
Good luck with the research
Sure thing Sir. Thank you very much :)