Proposal: Javac Abstract Syntax Tree Viewer

Jan Lahoda jan.lahoda at oracle.com
Mon May 5 14:25:25 UTC 2014


Hi Chris,

On 05/02/2014 02:55 PM, Chris Newland wrote:
> Hi Jan,
>
> Do you mean something like this:
> http://www.eclipse.org/jdt/ui/astview/index.php

Yes, something like that (inspired more by the NetBeans version of 
thereof, and providing some more information about javac internal states).

>
> I'm also working on a tool as part of the Adoption Group
> (https://wiki.openjdk.java.net/display/Adoption/Main) that may be suitable
> for code-tools.
>
> I don't mean to hijack the thread but there may be some crossover.
>
> I've built a tool called JITWatch[1] for visualising the result of
> HotSpot's LogCompilation output but it can also be used for more general
> bytecode analysis and I think an AST viewer would be a great addition.
>
> Happy to work together on this if you like?

Not sure how big is the overlap (analysis of compile-time data compared 
to analysis of run-time data), but if it would make sense, we should 
collaborate. What are your plans on this?

Thanks,
     Jan

>
> Kind regards,
>
> Chris Newland
> @chriswhocodes
>
> [1] https://github.com/AdoptOpenJDK/jitwatch/wiki
>
>
>> Hi Volker,
>>
>> I was not considering that so far. I might have been confusing saying
>> "graphical". What I meant so far was a GUI, not painting the AST as a
>> graph. My current prototype is simply a text pane showing the source
>> code and a tree view showing the AST for the source code.
>>
>> Thanks,
>>       Jan
>>
>> On 05/02/2014 07:48 AM, Volker Simonis wrote:
>>> Hi Jan,
>>>
>>> will this new tool integrate with and/or reuse parts of the Ideal Graph
>>> Visualizer [1], [2] already used in HotSpot and Graal?
>>>
>>> Thanks,
>>> Volker
>>>
>>> [1] http://ssw.jku.at/General/Staff/TW/igv.html
>>> [2]
>>> https://wikis.oracle.com/display/HotSpotInternals/IdealGraphVisualizer
>>>
>>> On Monday, April 28, 2014, Jan Lahoda <jan.lahoda at oracle.com
>>> <mailto:jan.lahoda at oracle.com>> wrote:
>>>
>>>      Hi,
>>>
>>>      I would like to propose a tool for inclusion to the Code Tools
>>> project:
>>>
>>>      ---
>>>      Tool Name: Javac Abstract Syntax Tree Viewer
>>>
>>>      Summary: Graphical viewer for inspection of AST, and other data,
>>>      produced by the standard Java compiler, javac.
>>>
>>>      Proposed By: Jan Lahoda
>>>
>>>      Rationale:
>>>      The way javac models source code is not always easy to grasp,
>>>      despite all attempts to make it as convenient as possible. Being
>>>      able to actually see and inspect the AST and related information
>>>      using a convenient UI is therefore very useful.
>>>
>>>      Hereby, a GUI tool to visualize javac ASTs and related information
>>>      is proposed for the Code Tools project. The primary target audience
>>>      of the tool are clients using the javac source code modeling APIs.
>>>      Secondary target audience are javac developers themselves. The tool
>>>      should therefore also support inspection of javac internal aspects
>>>      of the model.
>>>      ---
>>>
>>>      Thanks,
>>>           Jan
>>>
>>
>
>


More information about the code-tools-dev mailing list