Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
206 views
in Technique[技术] by (71.8m points)

How can I create a custom Eclipse Syntax Highlighter

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++.

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.

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

question from:https://stackoverflow.com/questions/746031/how-can-i-create-a-custom-eclipse-syntax-highlighter

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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

(The above link is now dead. This may be a similar document or this.)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...