Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How to get internal.compiler ASTnodes from core.dom ASTnodes?
How to get internal.compiler ASTnodes from core.dom ASTnodes? [message #1790476] Mon, 11 June 2018 14:06 Go to next message
Federer Roger  is currently offline Federer Roger Friend
Messages: 19
Registered: December 2017
Junior Member
As I known, jdt has two sets of implementation for FieldDeclaration, MethodDeclaration and TypeDeclaration. If I have already got the ASTNode in core.dom, can I get the corresponding internal.compiler ASTNode?
Re: How to get internal.compiler ASTnodes from core.dom ASTnodes? [message #1790547 is a reply to message #1790476] Tue, 12 June 2018 17:21 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1627
Registered: July 2009
Senior Member
Package o.e.j.internal.compiler.ast is "internal", and thus not intended to be used by clients.
Why wouldn't the public AST suffice for you?
Re: How to get internal.compiler ASTnodes from core.dom ASTnodes? [message #1790562 is a reply to message #1790547] Wed, 13 June 2018 01:24 Go to previous message
Federer Roger  is currently offline Federer Roger Friend
Messages: 19
Registered: December 2017
Junior Member
I need to finish a tool demo using a web editor code-mirror. There are two scenes. Content highlight and Open Declaration. Of course, I want to use JDT-core as the back-end to support these features.

If I select a variable all same words are highlighted. I guess it may be implemented by getting all the references of this target ASTNode. However, I can't find any useful method in public AST classes like (getReference or getReferenceBinding). And I also have this problem in OpenDeclaration. I can't find any method or interface like (findDeclaration or getDeclaration) in public AST or public IBinding classes.

I download jdt-core and jdt-ui source code and debug my need in Eclipse. But I see a lot wrapper classes like IJavaElement or IJavaProject as a parameter in the MatchLocator or Search class. In fact, I am not sure if I can achieve my goal by using JDT as a standalone application.

[Updated on: Wed, 13 June 2018 01:26]

Report message to a moderator

Previous Topic:Problem for updating Eclipse Oxygen
Next Topic:How to use Nd structure to store CompilationUnit and BindingResolver info?
Goto Forum:
  


Current Time: Thu Sep 20 13:26:38 GMT 2018

Powered by FUDForum. Page generated in 0.01983 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top