Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-08-2008, 09:15 PM
Member
 
Join Date: Oct 2008
Posts: 1
j_aquino314 is on a distinguished road
Need help with AST usage on Eclipse! Thanks!
Hello everyone!

As of now, my colleagues and I working on our project for refactoring opportunity detection have been able to parse java code to be used with AST only in the icompilationunit level. We would like to know how we would be able to parse code from the ijavaproject level. Any sample codes would be helpful. We have tried looking around for answers/codes and the code given in the AST tutorial of eclipse.

Code:
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProject project = root.getProject("someJavaProject"); project.open(null /* IProgressMonitor */); IJavaProject javaProject = JavaCore.create(project); IType lwType = javaProject.findType("net.sourceforge.earticleast.app.Activator"); ICompilationUnit lwCompilationUnit = lwType.getCompilationUnit();
only gives us the error message "workspace is closed".

after looking for answers on the net, we have found the following but do not know of how to implement them (the replies are not really easy to understand/follow):

-This means you are not running under Eclipse but instead under just a standard java application.
-I had org.eclipse.core.resources in the build path rather than having it as a dependent plugin in the plugin manifest.mf file. So the ResourcePlugin was not being instantiated by eclipse although the I could still make calls to the ResourcePlugin class with the code.


Does this mean that we can only code the project as a plugin in order for parsing at an ijavaproject level to work?

Any clear or step by step explanations to solve some problems/misunderstandings would be gladly appreciated. Thank you very much in advance!
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
JVM memory usage lardum New To Java 7 06-26-2008 05:30 AM
Timer usage in java program sandeeprao.techno New To Java 5 01-24-2008 09:16 PM
Integer Usage bluegreen7hi New To Java 11 01-24-2008 10:54 AM
How to determine CPU usage using Java????? JavaEmpires New To Java 2 01-11-2008 01:19 AM
Comm API Usage hobbyist New To Java 0 11-16-2007 06:59 PM


All times are GMT +3. The time now is 01:29 PM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org