如何创建自定义 Eclipse 语法荧光笔

我一直在为一种新语言开发编译器.我认为能够在语法感知环境中展示它的开发会很好.该语言有不少自定义关键字,其结构与Java或C/C++等常见语言有很大不同.

I've been developing a compiler for a new language. I thought it would be neat to be able to demonstrate its development in a syntax aware environment. The language has quite a few custom keywords, and its structure is significantly different than common languages such as Java or C/C++.

如何为 Eclipse 开发自定义语法高亮?我看过一些对一些插件的引用,但文档对于我初学者的需求来说不够全面.

How can I develop a custom syntax highligher for Eclipse? I've seen some references to a few plugins, but the documentation is not thorough enough for my beginner's needs.

我有我的语言的语法/RE,以及相关关键字的列表.

I have a grammar/REs for my language, as well as lists of relevant keywords.

推荐答案

Eclipse 框架使用一个相当复杂的文档模型来做语法着色(他们称之为着色,不是高亮),它不像其他的那么简单编辑.

The Eclipse framework uses a fairly complex document model to do syntax coloring (they call it coloring, not highlighting), it is not as simple as it is in other editors.

如果您真的想尝试并弄乱它,您可能需要阅读 Eclipse 插件开发者指南中的以下内容.

If you really want to try and mess with it, you may want to read the following from the Eclipse plug-in developer guide.

(上面的链接现在已经失效了.这可能是一个类似的文件或这个.)

相关文章