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

AMPL language

by JackDunnNZ ST2/ST3

Syntax Highlighting for the AMPL modelling language

Details

  • 2015.03.10.21.34.16
  • github.​com
  • github.​com
  • 3 years ago
  • 25 minutes ago
  • 4 years ago

Installs

  • Total 2K
  • Win 1K
  • OS X 533
  • Linux 327
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 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4
Windows 2 0 0 1 0 0 2 2 1 2 7 2 2 4 5 1 2 2 0 2 2 1 1 4 0 2 1 4 2 1 2 1 1 1 5 2 4 0 3 1 1 1 0 1 1 1
OS X 0 0 1 0 0 0 5 1 0 0 0 0 0 0 0 0 3 1 1 1 0 2 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 2 2
Linux 0 1 0 1 1 0 1 1 0 2 0 0 0 0 0 0 0 2 0 0 1 0 0 0 0 1 0 0 0 1 1 1 0 7 0 0 0 1 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

AMPL package for Sublime Text 2

Provides syntax highlighting for the AMPL modelling language (.mod, .dat and .run files).

Installation

Using Sublime Package Control (recommended): If you have installed Sublime Package Control, you can easily install the AMPL Language package via the Package Control: Install Package menu item (shortcut: CTRL+SHIFT+P). Search for AMPL Highlighting in the list.

Without Git: Download the latest source zip from github and extract the files to your Sublime Text “Packages” directory, into a new directory named AMPL.

With Git: Clone the repository in your Sublime Text “Packages” directory:

git clone git://github.com/jackdunnnz/sublime-ampl.git AMPL

The “Packages” directory is located at:

  • OS X: ~/Library/Application Support/Sublime Text 2/Packages/
  • Linux: ~/.Sublime Text 2/Packages/
  • Windows: %APPDATA%/Sublime Text 2/Packages/

You can access it through the menu in Preferences > Browse Packages...

OS X

On OS X, further configuration is needed in order for license files to be found (the environment variables need to be added manually to the sublime-build file). Create a file in Packages/User named AMPL.sublime-build with the following content:

{
    "osx":
    {
        "env":
        {
            "ILOG_LICENSE_FILE": "path/to/access.ilm"
        }
    }
}

Replace path/to/access.ilm with the actual path to your ILOG license file.

AMPL language

AMPL, an acronym for “A Mathematical Programming Language”, is an algebraic modelling language for describing and solving high-complexity problems for large-scale mathematical computation (i.e. large-scale optimization and scheduling-type problems).

AMPL is available from http://www.ampl.com/

Features

This package adds syntax highlighting for all built-in functions, as well as strings, numeric values (including Infinity), and function arguments.

Comments are also highlighted. In AMPL, line comments are started by #, and block comments are delineated by /* */.

To solve an AMPL model, ctrl+B (Build) will invoke AMPL on the .run file for the model. This can be done from any of the files for the model, provided that the .run script shares the same name as the current file e.g. building example.mod would invoke AMPL on example.run.

Support

This package is a port of the AMPL highlighting scheme for VIM. If there are any issues or suggestions to do with the highlighting, please let me know.