How to customise Eclipse for my own language? - eclipse

I have made a simple experimental language of my own. I want make Eclipse editor plugins or whatever I need to edit the programs for my language.
How do I begin with writing an Eclipse feature for my language?

How about trying Eclipse Xtext?
(That is if your language can follow an EBNF grammar)
Xtext is a framework for development of textual domain specific languages (DSLs).
Just describe your very own DSL using Xtext's simple EBNF grammar language and the generator will create a parser, an AST-meta model (implemented in EMF) as well as a full-featured Eclipse text editor from that.
alt text http://www.eclipse.org/Xtext/images/screenshot-title.png
The Framework integrates with technology from Eclipse Modeling such as EMF, GMF, M2T and parts of EMFT.
Development with Xtext is optimized for short turn-arounds, so that adding new features to an existing DSL is a matter of minutes. Still sophisticated programming languages can be implemented.

Related

Xtext and GMF integration

First of all, I have seen many links on stackoverflow of integrating XText with GMF.
The most consistent tutorial I've seen so far was: http://www.eclipse.org/forums/index.php/mv/msg/472225/1036564/#msg_1036564
..But not even generate a textual editor in the final step (only GMF editor).
I also saw the documentation, but I can not understand what they suggest in this link: http://www.eclipse.org/Xtext/documentation.html#gmf_integration
So I wonder if anyone knows how to integrate effectively the GMF with Xtext with an existing ecore! Use the XText 2.0.4.
Thank you!
Depending on how fixed you are on using GMF, you may want to look at Graphiti (built on GEF).
Graphiti is an Eclipse-based graphics framework that enables rapid development of state-of-the-art diagram editors for domain models. Graphiti can use EMF-based domain models very easily but can deal with any Java-based objects on the domain side as well.
There is an Eclipse Labs project for creation of Graphiti editors using an XText DSL, called Spray.
This project aims to provide one or more Domain Specific Languages (DSL) to describe Visual DSL Editors against the Graphiti runtime, and provide code generation to create the boilerplate code for realizing the implementation against the Graphiti framework. Potentially the Spray DSL can be used to generate code for other frameworks as well.
You can import your DSL ecore model into Spray, and using references to your DSL's types create a graphical editor with relatively little boilerplate. The presentation at CodeGen 2012 (SprayCodeGeneration2012.pdf on the Google Code link above) highlights some of Spray's features.

eclipse source code editor plugin to use with ANTLR

I've created my 'new programming language' using the ANTLR framework. The language is defined by its grammar and semantics are enforced using tree walkers that traverse the AST.
I want to develop an eclipse plugin to serve as a source code editor to write programs in my new language.
For example I would like to highlight keywords, mark lines with syntactic/semantic errors, etc.
What is the best way to approach this?
Anyone knows of any lib/framework which integrates easily with ANTLR to do this?
Thanks.
I would recommend Xtext framework, it is based on ANTLR + EMF. Fully functional source code editor with customizable autocomplete + quickfix... can be done easily with that
Eclipse dltk plugin would be the better option for this.

Difference between IDE and Framework

What is a difference between an IDE and Framework with respect to Java?
Basically :
The IDE is the software you use to develop ; for example, Eclipse is an IDE (code editor, debugger, build tools ... )
The Framework is a set of both libraries and best practices that help you not re-invent the wheel, and provide a set of guidelines on how to develop.
Quoting wikipedia, an IDE :
is a software application that
provides comprehensive facilities to
computer programmers for software
development. An IDE normally consists
of:
a source code editor
a compiler and/or an interpreter
build automation tools
a debugger
While a Framework :
is an abstraction in which common code
providing generic functionality can be
selectively overridden or specialized
by user code, thus providing specific
functionality. Frameworks are a
special case of software libraries in
that they are reusable abstractions of
code wrapped in a well-defined
Application programming interface
(API), yet they contain some key
distinguishing features that separate
them from normal libraries.
An IDE is an application used to write and compile code. A framework is generally a software component that someone else wrote that you can use/integrate into your own project, generally to avoid re-inventing the wheel.
A framework is a tool that is closely attached to the language you are using and usually extends upon or adds the the language features.
An IDE (Integrated Development Environment) provides automation support for the language you use with regards to syntax highlighting of keywords, errors, building projects, cleaning them, intgegration with VCS, etc. and usually provides default support for popular frameworks used for your language.
Java makes use of frameworks like Hibernate, Struts and Spring to extend the language and NetBeans or Intellij IDEA bring support for these tools to your Java project in a structured manor.
As per all answers I can come to a conclusion that Visual Studio is an IDE and .NET is a framework.
And also a framework(list of .dll) can be integrated into an IDE. Mean framework is a part of an IDE.

Editor library used in Eclipse source

I am looking to create an editor and I was wondering if there was a Swing library which Eclipse uses for its main editor. It may be something quite basic, but I am looking for the drop down menus which come when you press full stop. Strings become symbols rather than just text.
Eclipse is rather SWT-based than Swing-based.
As for a custom editor, you could look into an eclipse-GMF-EMF-based editor with XText
Xtext is a framework for development of textual domain specific languages (DSLs).
Just describe your very own DSL using Xtext's simple EBNF grammar language and the generator will create a parser, an AST-meta model (implemented in EMF) as well as a full-featured Eclipse text editor from that.
alt text http://www.eclipse.org/Xtext/images/screenshot-title.png
The Framework integrates with technology from Eclipse Modeling such as EMF, GMF, M2T and parts of EMFT.
Development with Xtext is optimized for short turn-arounds, so that adding new features to an existing DSL is a matter of minutes. Still sophisticated programming languages can be implemented.
Actually I think you want to consider developing an Eclipse RCP application which involves using SWT, JFace and other parts of the Eclipse platform. There are many layers of editor support which are in the Platform Text component, this is what the Eclipse JDT editors are based on. The modelling stuff (GMF, EMF, etc) is probably much more than what you want. The AbstractTextEditor class in org.eclipse.ui.texteditor is a good place to start. RCP gets you a lot of other stuff as far as helping you to manage the objects you are editing, but you don't necessarily need to use this.
There are likely Eclipse corner (on eclipse.org) articles on how to do this, but the specific one escapes me now. I always just look at the code.

Customizability of the IDEs

I am thinking of modifying an existing IDE (Ex : By developing a plugin) to provide support for a proprietary scripting language. I just need to implement few features like syntax highlighting, Autocompleting etc. (i.e the requirements are really simple). What would be the best IDE or Text editor to integrate the feature. As an example if I think to develop an eclipse plugin for that it would be a pain.
What do you think about Notepad ++?
You might want to give the NetBeans Generic Language Framework a try.
NetBeans project called Generic Languages Framework allows you to define a programming language and integrate it to NetBeans IDE. In the first step you should describe the language - lexical part (define tokens using regular expressions) and syntax (grammar rules). In the second step you can define how to visualize this language in NetBeans. You can define colors for tokens (syntax coloring) or folding (based on grammar rules). You can define what parts of this language should be displayed in the navigator, and how to indent this language plus many other features.
This tutorial should guide you through the process of creating new NetBeans module, adding languages support into it, describing lexical and syntax structure of your language and adding support for all standard editor # features for your language.
Notepad++ allows you to define custom syntax highlight files in a very easy way, but it's not a very good solution for auto-completion (look at this SO question).
If you want a real IDE to extend, I suggest you to use Eclipse.
Update: Tutorial on how to develop an Eclipse plugin.
In vim you can easily add your custom syntax highlighting rules by adding another file in the syntax folder; for the details it is best to look at the help.
If I remember correctly notepad++ also allows defining custom syntax files.