Syntax Highlighting tool/language that works with multiple editors

Is there any tool that would allow me to specify syntax highlighting for a given language, then generate syntax highlighting files for some of the more common editors?

I ask because I'm developing a domain-specific language, and I'd like to provide syntax highlighting support for said language. However, I don't want to write separate syntax highlighting files for each editor (Vim, Notepad++, Visual Studio, etc.).

This type of translation seems possible, as the core concepts for syntax highlighting generally independent of what editor you're using. I just don't know if such a thing already exists.


Quite a lot of editors use scintilla (http://www.scintilla.org/) for source code editing and syntax highlighting: for instance Notepad++ on windows, gedit in gnome, Code::blocks. You may therefore consider adding a syntax definition to Scintilla. As far as I understand this is a matter of writing a xml definition of a lexer for your language (see for instance this page for Code::Blocks)


I don't know of anything like that, but in my opinion it would be quite easy to produce. For example, one can create an XML-based universal format (in form of a DTD/XSL scheme) and use editor-specific XSLT transformations. Then, each editor creator (or someone else) would create an XSLT file for his editor. And for each new language, an XML would be created.

The biggest problem is to specify such a language that would satisfy at least these criteria:

  • Completeness: it should contain all possible features of syntax highlighting configuration.
  • Ease of use: it shouldn't be overly complicated for simple languages.
  • Openness and standardization: it should be popular to be useful. To be popular, it should be open and standardized.
  • 链接地址: http://www.djcxy.com/p/52356.html

    上一篇: 前缀宏,类似于'?

    下一篇: 语法突出显示适用于多个编辑器的工具/语言