English 中文(简体)
How to create an Eclipse editor plugin with syntax checking and coloring as fast as possible?
原标题:

I m working on a project that requires me to create a series of editors for languages that are quite different. The syntaxes are defined by us.

I m looking for a solution for this. Is there a shortcut to take in this problem?

最佳回答

You could use XText:

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

问题回答

Alternatives to XText are Rascal or Spoofax, both less popular than XText but interesting for they support more general context-free grammars, among other things. Nice to check out.

If you are looking for a more low level, programmable solution, then Eclipse s IDE Meta-tooling platform is a good choice (IMP).

What IMP gives you is API to connect your existing parsers to Eclipse without much hassle. You need to implement an IParseController interface, to call your parser and ITokenIterator to produce tokens and some other interface to assign fonts to each kind of token.

The aforementioned Rascal and Spoofax are both build on top of IMP.

Not mentioned is DLTK (proposed also in Tutorial regarding the development of a custom Eclipse editor)

There are Ruby, bash that are implemented with it.





相关问题
Two Eclispse projects -> One Eclipse Plug-in

Background I m a developer of the Vrapper project. Vrapper contains of 2 major parts Vim-emulation library (vrapper.core) Eclipse part that makes a good use of it We want vrapper.core to be ...

Error in Preview of Custom Eclipse refactoring

I am implementing an new eclipse refactoring. This will enable developers to Pull-up the preconditions statements from a child method to the parent method. This all works perfectly when I select "...

Eclipse git checkout (aka, revert)

Is it possible to do the equivalent of git checkout from within Eclipse using the EGit plugin? I have a file that s been modified. I want to discards the changes and revert the file back to what s in ...

Adding jar from Eclipse plugin runtime tab

I want to add .jar files for plugin from the Runtime tab of manifest file. When I use the Add... button, I can see only sub-directories of the plugin project. So if I want to add same .jar file to ...

BlackBerry JDE Eclipse Plugin 1.1 on Windows 7

Has anybody been able to run the new plugin beta v1.1 on Windows 7? When I run the installer, it pops up an error that states "Please select another location to extract the installer to". It ...

How to not write the DocumentRoot to the XML

I m using EMF, and I created my ecore from XSD. I notice that the XML that are being saved by the editor have the element DocumentRoot, which is not part of my original XSD. Can I somehow not ...

How do you fix loading plugins in eclipse 3.5.1 on linux?

I have two linux boxes. Both Fedora 11 x64. On one, I downloaded the eclipse-java-galileo-SR1-linux-gtk-x86_64.tar.gz. I unpacked it to /opt/eclipse-3.5.1/ and used the Install New Software... item ...

热门标签