Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #7335

Re: Using sun javac to parse java source

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!feed118.news.tele.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Date Tue, 23 Aug 2011 21:52:41 -0400
From Arne Vajhøj <arne@vajhoej.dk>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: Using sun javac to parse java source
References <66227810-c927-4197-a138-f25b54f26f7f@k8g2000yqk.googlegroups.com> <4e543134$0$305$14726298@news.sunsite.dk> <7731799a-db7a-4b5a-b885-9852338f304e@glegroupsg2000goo.googlegroups.com>
In-Reply-To <7731799a-db7a-4b5a-b885-9852338f304e@glegroupsg2000goo.googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 8bit
Lines 30
Message-ID <4e545973$0$315$14726298@news.sunsite.dk> (permalink)
Organization SunSITE.dk - Supporting Open source
NNTP-Posting-Host 72.192.23.157
X-Trace news.sunsite.dk DXC=1Z1PeTW5MShCf4eYcI3F5hYSB=nbEKnkk4ang]8e?Co`JPe3\kP5EUaKBm9cfh9BSdM2;kT<[:>[a01VcV6Nn9RgAXG1a@YCI@`
X-Complaints-To staff@sunsite.dk
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7335

Show key headers only | View raw


On 8/23/2011 8:25 PM, Lew wrote:
> Arne Vajhøj wrote:
>> Alex J wrote:
>>> I'm curious whether it is possible to use JavacParser -
>>> http://docjar.org/docs/api/com/sun/tools/javac/parser/JavacParser.html
>>> - built-in to OpenJDK to parse standalone java files (though claimed
>>> to be "internal use only API"). I googled but I've found no answers.
>>
>> Java 1.6 and newer contains a supported callable Java compiler.
>>
>> Use that.
>
> +1.
>
> Java 5 and older are obsolete, so that settles that.
> <http://en.wikipedia.org/wiki/Java_version_history#J2SE_5.0_.28September_30.2C_2004.29>
>
>> If you only want to syntax check you will need to discard the
>> generated byte code in case of success, but that is easy.
>>
>> The API is a bit complex many would say over engineered, but
>> it works fine.
>
> It pays to know the API.
> <http://download.oracle.com/javase/6/docs/api/javax/tools/package-frame.html>

Sure, but it is still a complex API.

Arne

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Using sun javac to parse java source Alex J <vstrength@gmail.com> - 2011-08-23 13:24 -0700
  Re: Using sun javac to parse java source Arne Vajhøj <arne@vajhoej.dk> - 2011-08-23 19:00 -0400
    Re: Using sun javac to parse java source Lew <lewbloch@gmail.com> - 2011-08-23 17:25 -0700
      Re: Using sun javac to parse java source Arne Vajhøj <arne@vajhoej.dk> - 2011-08-23 21:52 -0400
        Re: Using sun javac to parse java source Lew <lewbloch@gmail.com> - 2011-08-23 20:20 -0700
          Re: Using sun javac to parse java source Arne Vajhøj <arne@vajhoej.dk> - 2011-08-24 19:22 -0400
            Re: Using sun javac to parse java source Lew <lewbloch@gmail.com> - 2011-08-24 21:05 -0700
    Re: Using sun javac to parse java source Sebastian <sebastian@undisclosed.invalid> - 2011-08-24 10:51 +0200
      Re: Using sun javac to parse java source Arne Vajhøj <arne@vajhoej.dk> - 2011-08-24 19:19 -0400

csiph-web