DZone Forums
Go Back   DZone Forums > Community > Languages & Frameworks > Java
Reload this Page java Compiler API tree
Notices
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Join Date: Jan 2009
Default java Compiler API tree - 02-02-2009, 11:01 AM

hi
can anyone tell me how to use Compiler API in java 6 to generate AST for a given source ?

and how to iterate over the nodes of that tree and extract the attributes of each node (name ,content,type , and so on)?

thanks
Reply With Quote
  (#2 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Feb 2009
Default 02-04-2009, 02:10 AM

See here:

javax.tools (Java Platform SE 6)

Compiler Tree API
Reply With Quote
  (#3 (permalink)) Old
Moderator
 
jwenting's Avatar
 
Posts: 125
Thanks: 0
Thanked 10 Times in 10 Posts
Join Date: Feb 2008
Send a message via MSN to jwenting
Default 02-04-2009, 02:12 AM

no need to shout, use a regular size font...
And no need to crosspost between forums. Most people likely to be able and willing to answer your question visit most or all of them and only get annoyed by it.
Reply With Quote
  (#4 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Feb 2009
Default another alternative - 02-04-2009, 05:05 AM

HAve a look at UsingThisParser - javaparser - How to use this Java Parser - Google Code.
This is a very easy to use Java Parser built with JavaCC
Reply With Quote
  (#5 (permalink)) Old
Member
 
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Join Date: Jan 2009
Default 02-05-2009, 09:11 AM

Quote:
Originally Posted by jwenting View Post
no need to shout, use a regular size font...
And no need to crosspost between forums. Most people likely to be able and willing to answer your question visit most or all of them and only get annoyed by it.
thanks,I didn't mean that.sorry for annoying you.

and about the sent links ,I shall try it ,thank you all.
Reply With Quote
Reply

Tags
api, ast, compiler, java, tree

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie: compiler settings lillo64 Eclipse 1 08-31-2008 10:18 PM
newbie: compiler settings lillo64 Java 1 08-31-2008 10:13 PM
Tree column hide merovingian Eclipse 0 08-20-2008 12:35 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com