Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!newsgate.cuhk.edu.hk!news.netfront.net!not-for-mail From: Wanja Gayk Newsgroups: comp.lang.java.programmer Subject: Re: I develop a Java program to format Java codes Date: Sat, 10 Mar 2012 13:01:20 +0100 Organization: Netfront http://www.netfront.net/ Lines: 29 Message-ID: References: <5690138.193.1330687781011.JavaMail.geo-discussion-forums@ynca15> <15449731.9.1330732532136.JavaMail.geo-discussion-forums@ynbq18> NNTP-Posting-Host: 77.8.58.140 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: adenine.netfront.net 1331380874 83053 77.8.58.140 (10 Mar 2012 12:01:14 GMT) X-Complaints-To: news@netfront.net NNTP-Posting-Date: Sat, 10 Mar 2012 12:01:14 +0000 (UTC) User-Agent: MicroPlanet-Gravity/3.0.4 Xref: csiph.com comp.lang.java.programmer:12833 In article <15449731.9.1330732532136.JavaMail.geo-discussion- forums@ynbq18>, gearss8888@gmail.com says... > > I am a Java beginner As a beginner in programming, you should really better start with a lower hanging fruit. If you have done this in other languages before, and are just a beginner in Java, good luck. Still, if you're new to programming, you will probably quite quickly see that this is not as trivial as you thought it was - if you want to do it right that is. Properly formating Java code involves first parsing the code into an AST, an abstract syntax tree, and then exporting the AST to text using your own formatting-rules for indentation, spaces, line breaks, etc. You wil probably quite quickly hit the first problem with simple mathematic expressions, lika a=(b+c)*t, let alone making a distinction with string-concatenation and variables and method calls within those. Kind regards, -- ..Alesi's problem was that the back of the car was jumping up and down dangerously - and I can assure you from having been teammate to Jean Alesi and knowing what kind of cars that he can pull up with, when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer] --- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---