How can I create a custom Eclipse Syntax Highlighter(如何创建自定义 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.
(上面的链接现在已经失效了.这可能是一个类似的文件或这个.)
这篇关于如何创建自定义 Eclipse 语法荧光笔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何创建自定义 Eclipse 语法荧光笔
基础教程推荐
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 降序排序:Java Map 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01