Files
gf-core/src/runtime/haskell-bind
kr.angelov 9bc5349e62 change in the API for literals
The API in the C runtime as well as in the Haskell, Python and Java binding
is changed. Now instead of adding the literal callbacks to the concrete syntax
you need to supply them every time when you need to parse. The main reason is:

- referentially transparent API for Haskell
- when we start using memory mapped files we will not be allowed to change
  anything in the grammar data structures. At that point the old API would
  be impossible to use.
2014-12-16 10:21:26 +00:00
..
2014-12-16 10:21:26 +00:00
2014-12-16 10:21:26 +00:00
2014-02-09 20:56:01 +00:00
2014-12-16 10:21:26 +00:00

This is a binding to the new GF runtime in C.

The files are:

PGF2.hsc         -- a user API similar to Python and Java APIs
PGF2/FFI.hs      -- an internal module with FFI definitions for 
                 -- the relevant C functions

HOW TO COMPILE:

cabal install

HOW TO USE:

- Import PGF to the Haskell program that you're writing. 
  The Cabal infrastructure will make sure to tell the compiler
  where to find the relevant modules. Example:

  module Main where

  import PGF2
  import qualified Data.Map as Map

  main = do
    pgf <- readPGF "Foo.pgf"
    let Just english = Map.lookup "FooEng" (languages pgf)