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.29.16.29.11
  • github.​com
  • github.​com
  • 3 days ago
  • 15 minutes ago
  • 12 years ago

Installs

  • Total 252
  • Win 133
  • Mac 68
  • Linux 51
Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 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
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 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.6.0

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 clafersg.
  • Instance generation in a Terminus tab:
    • Alloy-based instance generator (claferIG) ctrl+i, g, a
    • Choco-based instance generator (clafersg) 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, clafersg, 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.