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 语法荧光笔
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01