ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Clafer Tools

by gsdlab ALL

Integration of Clafer Compiler and Instance Generators into Sublime Text 2/3

Details

  • 2026.11.08.18.23.43
  • github.​com
  • github.​com
  • 2 days ago
  • 5 hours ago
  • 12 years ago

Installs

  • Total 252
  • Win 133
  • Mac 68
  • Linux 51
Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27
Windows 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Clafer Tools

v0.5.7

Integration of the Clafer compiler and instance generators into Sublime Text 4.

Contributors

Features and Usage

In a Clafer model (.cfr):

  • Syntax highlighting of keywords, operators, comments, strings and numbers, compiler directives (//# OPTIONS on the first line, //# FRAGMENT, //# GRAPH, //# STATS, //# SUMMARY), and embedded Alloy and JavaScript ([alloy| … |], [choco| … |]).
  • Compilation ctrl+b (Tools > Build): the compiler's errors are shown in the model, at their position, and its output in a panel. An error in a file that the model imports (--import, Clafer 0.5.4) is shown at the start of the model, with the file and the position in it, and in that file if it is open; double-click the error's underlined position in the panel, or press F4, to open the file at the error. The variant Validate (ctrl+shift+b) also validates the generated outputs with Alloy and chocosolver.
  • Instance generation in a Terminus tab:
    • Alloy-based instance generator (claferIG) ctrl+i, g, a
    • Choco-based instance generator (chocosolver) ctrl+i, g, c
  • The Command Palette has the same commands under Clafer:.

Installation

  1. Install Sublime Text 4.
  2. In Sublime Text, install the packages Clafer Tools and Terminus with Package Control: Tools > Command Palette > Package Control: Install Package.
  3. Download a binary distribution of the Clafer tools and unpack it into a folder of your choice. The instance generators need Java 21 or later.
  4. Either add that folder to PATH, or set tools_path to it in Preferences > Package Settings > Clafer Tools > Settings.

Settings

  • tools_path: the folder of the Clafer tools (clafer, claferIG, chocosolver.jar, alloy6.2.0.jar). Empty (the default): use the tools on PATH.
  • clafer_args: the arguments of clafer for compilation; the model is added at the end. Default: ["-m", "alloy", "-m", "choco", "-m", "html", "--self-contained"].

Development

syntax_test_clafer.cfr tests the syntax: open it and run Tools > Build With… > Syntax Tests.