Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Reuse Java components (parser, auto completion, ...) for composite language
Reuse Java components (parser, auto completion, ...) for composite language [message #841499] Wed, 11 April 2012 11:49 Go to next message
P N is currently offline P N
Messages: 2
Registered: April 2012
Junior Member
Hello,

I am developing a language which partially uses Java and some other languages. Now an important aspect is the tooling for the language. Is it possible to reuse some of the components already implemented in eclipse for java? That means, consider for example the following language:

public class MyClass {

   public void method(String table, String col, int val) {
   
      sql {
          INSERT INTO table (col) values (val);
      }

   }
}



The example shows a Java class with a method. This all is plain Java. Inside the method is a sql-Statement. I now liked to reuse all (or most of) the tooling support that Eclipse usually offers for Java. That means for example, if I am not in the context of sql { ... } auto completion etc. should still be supported.

Is this possible? If yes, what next steps should I do (which docs to read?)

Thanks in advance

P
Re: Reuse Java components (parser, auto completion, ...) for composite language [message #841561 is a reply to message #841499] Wed, 11 April 2012 13:23 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam Kandula
Messages: 444
Registered: July 2009
Senior Member
There has been some effort in to make JDT extensible, but is not complete. However, some are able to get the hold of it. Look at http://wiki.eclipse.org/Extending_JDT_For_Java_Like_Languages and the links there.
Re: Reuse Java components (parser, auto completion, ...) for composite language [message #841567 is a reply to message #841499] Wed, 11 April 2012 13:27 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5330
Registered: July 2009
Senior Member
XBase provides the foundation to embed java into your custom language.
I'd suggest you take a look at Xtext and Xbase (respectively their Xtend
language which is implemented on top of it - it even integrates into the
JDT-Debug stuff, ....)

Tom

Am 11.04.12 13:49, schrieb P N:
> Hello,
>
> I am developing a language which partially uses Java and some other
> languages. Now an important aspect is the tooling for the language. Is
> it possible to reuse some of the components already implemented in
> eclipse for java? That means, consider for example the following language:
>
>
> public class MyClass {
>
> public void method(String table, String col, int val) {
> sql {
> INSERT INTO table (col) values (val);
> }
>
> }
> }
>
>
>
> The example shows a Java class with a method. This all is plain Java.
> Inside the method is a sql-Statement. I now liked to reuse all (or most
> of) the tooling support that Eclipse usually offers for Java. That
> means for example, if I am not in the context of sql { ... } auto
> completion etc. should still be supported.
>
> Is this possible? If yes, what next steps should I do (which docs to read?)
>
> Thanks in advance
>
> P
>
Re: Reuse Java components (parser, auto completion, ...) for composite language [message #841674 is a reply to message #841567] Wed, 11 April 2012 16:08 Go to previous messageGo to next message
P N is currently offline P N
Messages: 2
Registered: April 2012
Junior Member
Thanks a lot, Satyam and Tom.
Re: Reuse Java components (parser, auto completion, ...) for composite language [message #843105 is a reply to message #841674] Thu, 12 April 2012 19:15 Go to previous message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 1007
Registered: July 2009
Senior Member
In case Java is really the host language for most of your code, and only snippets of another language are embedded, you may want to re-use the JDT as-is, rather than through any indirections. In this case and if you are ready to get your hands dirty, you might find some inspiration in two of my blog posts:
- http://blog.objectteams.org/2010/02/ide-for-your-own-language-embedded-in-java-part-1/
- http://blog.objectteams.org/2010/02/ide-for-your-own-language-embedded-in-java-part-2/

cheers,
Stephan
Previous Topic:How to org.eclipse.core.resources.IResource -> org.eclipse.jdt.core.ICompilationUnit
Next Topic:Import jsf 2.0 netbeans project in to Eclipse IDE Helios
Goto Forum:
  


Current Time: Fri Sep 19 22:05:56 GMT 2014

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

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