gumtree icon indicating copy to clipboard operation
gumtree copied to clipboard

Full description of Java AST node types

Open egor-bogomolov opened this issue 5 years ago • 3 comments

Is there a full documentation of node types in the AST generated by Java parser in GumTree?

For my work, I want to specify different behavior depending on node types and I want to do so outside of java/kotlin code. The information I'm looking for is, for each node type, the number of children and their descriptions (e.g., I assume that the node describing if statement has children corresponding to condition statement, block of the true branch and something for else branch).

If there are any documents describing parser's grammar, that would be awesome.

egor-bogomolov avatar Dec 09 '19 12:12 egor-bogomolov

Hi Egor,

This information is usually available on the underlying parser documentation (e.g. JDT for Java code). In some cases we perform some tiny tree rewriting, but most of the time, the structure of GumTree's AST is the same as the parser's one.

However the documentation is not always very easy to understand (for instance for JDT it is a JavaDoc thefore the hierarchy is not explicit). It would be very neat to have it for GumTree, but it would require a lot a documentation effort unfortunately.

jrfaller avatar Dec 09 '19 14:12 jrfaller

Thank you for your reply! We will try to auto-generate some documentation and post a link here.

egor-bogomolov avatar Dec 09 '19 15:12 egor-bogomolov

Any development on this @egor-bogomolov ?

jrfaller avatar Apr 16 '20 08:04 jrfaller