How can I create a custom Eclipse Syntax Highlighter

后端 未结 5 1757
猫巷女王i
猫巷女王i 2020-11-30 04:08

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 q

5条回答
  •  情书的邮戳
    2020-11-30 04:31

    This is exactly one of the targets of LiClipse (http://www.liclipse.com/): easily doing an editor with syntax highlighting, basic code-completion, outline, etc targeting Eclipse -- note that its core (which allows creating custom languages) became open source recently: http://liclipse.blogspot.com.br/2016/05/liclipse-303-providing-back-to-open.html.

    No java skills are required to add a new language (mostly creating a new .liclipse -- which is a YAML -- file in the proper place and creating some basic rules to say how to partition your language -- i.e.: usually just separating code from comments from strings -- and specifying the keywords you have in the partition would already give you proper syntax highlighting).

    If you download it, there are a number of examples at plugins\com.brainwy.liclipse.editor\languages and there's some basic documentation at http://www.liclipse.com/text/supported_languages.html and http://www.liclipse.com/text/scope_definition.html on how to do it.

提交回复
热议问题