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


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

Re: Using sun javac to parse java source

Date 2011-08-24 19:22 -0400
From Arne Vajhøj <arne@vajhoej.dk>
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> <4e545973$0$315$14726298@news.sunsite.dk> <b842fa00-d872-4ae8-a7e7-f0bd90090eec@glegroupsg2000goo.googlegroups.com>
Message-ID <4e5587be$0$309$14726298@news.sunsite.dk> (permalink)
Organization SunSITE.dk - Supporting Open source

Show all headers | View raw


On 8/23/2011 11:20 PM, Lew wrote:
> Arne Vajhøj wrote:
>> 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.
>
> Yes, it is.  That isn't a reason not to know it, if you need that functionality.
>
> Pardon my confusion, but aren't we both recommending the same API?  Are you suggesting that they not know this API now?
>
> Perhaps you misunderstand me to suggest that by "know the API" I do not mean to study the finer points of how to use it?
>
> Could anyone infer that by pointing to the first step on the road to knowledge that I mean they should sit on the curb at the beginning and go no further?
>
> Or perhaps you believe that after pointing the OP to the beginning of that journey I should do all the research for them, and Google on their behalf for all the further reading that they should do, or even read it for them and feed it predigested to them like a mommy-bird feeding her pre-fledgling babies?
>
> I see nothing in my earlier post to suggest that it is not a complex API, or that they should stop at the first indicated signpost.
>
> The value of the link to the API is that it shows some basic information, and given a certain level of programming experience or commitment or both it can lead them into study and experimentation that will solve their problem.  It indicates that the API is, indeed, standard, and gives hope that there is a solution.  There has been no assertion that competence with the API ends with reading the Javadocs.

There is this usenet tradition that comments relates to what is
is written below.

So when you talk about studying the API below my statement about it
being a complex API, then I assume that it relates to that.

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