An open-source, CLI based rewrite of Iro by Chris Ainsley, supporting automatic VSCode extension and Atom package generation. It's an easy to use command line tool, and will bundle up a provided Iro grammar and create various different grammar targets from it, automagically generating extensions to upload to the marketplace. Some of the available targets include:
- Textmate
- Atom
- Ace
- Pygments
- Rouge
- Sublime 3
- CSS
To create an Atom package and VSCode extension at the same time, you can use the following:
iro grammarFile.iro --vscode --atomext
To use the online official version of Iro, you can go to the official website. For documentation on how to create Iro grammars, check the official documentation here.
To get started using Iro4CLI on Windows, all you'll need is .NET Framework 4.7.1 or later, and you can download one of the prebuilt binaries from the Releases tab on the main repository page.
If you're using Linux, however, you'll have to build the project using Mono and mkbundle
. Make sure you have the following dependencies installed as a nuget packages before attempting to build with mkbundle
:
Antlr4
Antlr4.CodeGeneration
Antlr4.Runtime
CommandLineParser
Newtonsoft.Json
shortid
Once this is done, you can use a simple mkbundle
command such as the example below to create a native executable for your distro:
mkbundle -o iro --simple bin/Debug/iro.exe --machine-config /etc/mono/4.5/machine.config --no-config --nodeps bin/Debug/*.dll
For all command line options available, see the following Wiki page: https://github.com/c272/iro4cli/wiki/Command-Line-Options
For Iro grammars, an example grammar is something like the following:
name = exampleGram
file_extensions [] = exgr, exg;
styles [] {
.example : style {
//todo
}
}
I highly suggest you check the official documentation for more details, however.
So far the following targets have been implemented:
- Textmate
- CSS
- Ace
- Atom
- Pygments
- Rouge
- Sublime 3
Feature parity with Iro online here. Additional goals below.
- VSCode Extension Generation
- Atom Package Generation
- Sublime Extension Generation
- HighlightJS
- ANTLR Input