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 语法荧光笔
基础教程推荐
- 存储 20 位数字的数据类型 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
