Open-source image
open-source
Hime logo

Table of content

Edition

Hime - Grammars Edition Support

Hime grammars can be edited with any text editors. However, Hime grammars have edition supports in multiple environments.

Visual Studio Code

Complete support for the edition of Hime grammars is available in Visual Studio Code with the Hime Language Support extention. To install this extension, open up VS Code, hit F1, type ext, select Install Extension, type hime-language, hit enter and reload window to enable. The extension can also be downloaded here and manually installed.

This extension provides syntax highlighting, detection of the definitions and references to grammar symbols and navigation through them (goto symbol definition, etc.). The extension also provides support for testing the grammar within the editor. The grammar can be compiled within the editor and tested against a piece of input text.

This extension requires a local installation of Java. Java can be installed from Oracle or from the OpenJDK project. This extension looks for a local installation a Java using (in this order):

  • The hime.java configuration of VSCode.
  • The JAVA_HOME environment variable.
  • The PATH environment variable.

This extension uses the Language Server Protocol to connect to an embedded language server. The sources of the extension is provided here. The sources of the embedded language server is provided in hime-language-server. Its implementation relies on the implementation of the Language Server Protocol provided in xOWL Infrastructure.

Notepad++

Syntax highlighting for Hime grammars is available for Notepad++. The language specification file can be downloaded here.

To import a language specification in Notepad++, click on the menu View->User Define Dialog..., then on the button Import.

Linux GTK

Syntax highlighting for Hime grammars is available for GTK-based editors on Linux, such as gedit. The language specification files can be be downloaded for GTK 2 and GTK 3.

To install the language specifications, run:

# For GTK Source View 2.0
$ sudo cp gtk2_hgram.lang /usr/share/gtksourceview-2.0/language-specs/hgram.lang
$ sudo chmod go+r /usr/share/gtksourceview-2.0/language-specs/hgram.lang

# For GTK Source View 3.0
$ sudo cp gtk3_hgram.lang /usr/share/gtksourceview-3.0/language-specs/hgram.lang
$ sudo chmod go+r /usr/share/gtksourceview-3.0/language-specs/hgram.lang