(Documentation) (Test Results)
A Haskell library to translate ABS programs to Haskell equivalent code.
Before installing the HABS backend, you need the Glasgow Haskell Compiler (GHC) version >= 8.
a) Getting GHC on Ubuntu-Linux >= 17.04
apt-get update
apt-get install ghc cabal-install happy zlib1g-dev
b) Getting GHC on *-Linux, Windows, Mac
Get the Haskell Platform for your OS from https://www.haskell.org/platform
Clone and navigate to this repository:
git clone https://github.com/abstools/habs
cd habs/
Then, from inside the repository run:
git submodule update --init
cabal sandbox init
cabal sandbox add-source habs-parser
cabal sandbox add-source habs-runtime
cabal sandbox add-source haskell-src-exts-qq
cabal update
cabal install
Navigate to the cloned repository directory and run:
cd habs/
git pull
git submodule update
cabal update
cabal install
From inside the cloned repository run:
cd habs/
cabal exec habs -- Module1.abs Module2.abs
# the translated files are placed under gen/haskell
cabal exec ghc -- gen/haskell/*.hs --make -main-is Module1
# Run the main ABS program
./gen/haskell/Module1
, where -main-is
should point to the module which contains the main ABS block you want to execute.
The backend has been split into multiple subrepositories (git submodules):
- habs-parser: Contains the grammar & parser to parse ABS files.
- habs-runtime: A library to implement the concurrency features of the ABS language inside Haskell. Also contains the ABS standard library expressed directly in Haskell.
- habs (This repository): Contains the code-generator of ABS to Haskell.
- habs-samples: Contains an ABS test suite and other sample ABS files.