Reputation: 151
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.
Upvotes: 11
Views: 538
Reputation: 182
(Old question/answers but here you go) Seems like it's worth checking out Iro, "a development tool designed to simplify the creation of syntax highlighters across many platforms" - see this medium post: "Introducing Iro — An Easier Way To Create Syntax Highlighters" - https://medium.com/@model_train/creating-universal-syntax-highlighters-with-iro-549501698fd2
EDIT: removed the eeyo . io link in my initial post above. Just keeping the medium one. Thanks @usmanharoon for the heads-up.
Upvotes: 2
Reputation: 93
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)
Upvotes: 2
Reputation: 1499
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:
Upvotes: 1