Commit Graph

633 Commits

Author SHA1 Message Date
kr.angelov
b87104aa89 update the Eclipse project for jpgf with settings needed for Windows 2014-02-27 19:28:25 +00:00
hallgren
c9af5d11c0 Restore compatibility with GHC 7.0 2014-02-10 21:44:34 +00:00
kr.angelov
44a764cd2f proper error checking in the C runtime 2014-02-10 14:07:17 +00:00
hallgren
1bcb2d06e3 haskell-bind: fix broken pgf-shell
The type CId was replaced with String, so can't use show and read anymore.
2014-02-10 12:59:31 +00:00
kr.angelov
5818b0fe1b bugfix in pgf2-bind.cabal 2014-02-10 10:28:19 +00:00
kr.angelov
1746e3ad2a updated haskell-bind/README 2014-02-09 20:56:01 +00:00
kr.angelov
adeeb47e06 cleanup the code for the FFI binding. The API is now more uniform with the Python and the Java bindings. Fixed a lot of memory leaks. 2014-02-09 20:45:11 +00:00
kr.angelov
f30c60c3d7 GuVariant is now plain uintptr_t instead of a structure to make it easier to write Haskell bindings 2014-02-09 19:07:15 +00:00
hallgren
680bf64454 pgf-shell: show the names of the concrete syntaxes after loading the grammar 2014-02-07 16:40:13 +00:00
inari
8de56530e0 haskell-bind: add function languages 2014-02-07 15:56:12 +00:00
hallgren
9a422839cc pgf-shell: enable -rtsopts, call performGC between commands
This is to make it easier to find the cause of space leaks.
2014-02-07 13:57:13 +00:00
inari
957dfb83b6 fixed some memory leaks 2014-02-06 10:50:59 +00:00
kr.angelov
f23bcb8a47 bugfix in the recognizer for literals in the C runtime 2014-02-05 20:13:52 +00:00
hallgren
edeb094cf5 PGF.Optimize: one more fix for unsafeFreeze 2014-02-04 13:47:37 +00:00
hallgren
9df56550cd PGF.Optimize: import unsafeFreeze from Data.Array.Unsafe for compatibility with ghc-7.8 2014-02-04 13:44:07 +00:00
kr.angelov
e6ab8c4aa4 fix in the bracketedLinearize in Haskell 2014-01-31 08:52:32 +00:00
inari
f0ddf0fe72 changes to pools in haskell bindings 2014-01-29 16:02:07 +00:00
kr.angelov
55ea6cbec5 fix in the Haskell runtime 2014-01-24 08:34:55 +00:00
hallgren
9d71ffc831 Optionally include C run-time support
If the C run-time library is compiled and installed on your system, you can now
do 'cabal configure -fc-runtime' to get the following extras:
  + The haskell binding to the C run-time library will be included in the
    PGF library (so you can import it in Haskell applications).
    Documentation on the new modules will be included when you run
    'cabal haddock'.
  + The new command 'pgf-shell', implemented on top of haskell binding to
    the C run-time system.
  + Three new commands in the web API: c-parse, c-linearize and
    c-translate. Their interfaces are similar to the corresponding commands
    without the "c-" prefix, but they should be considered preliminary.
2014-01-20 17:06:11 +00:00
hallgren
801a20d27a haskell-bind: add an export list to hide internal stuff
It also makes the generated haddock documentaiton more structured.
2014-01-20 14:40:38 +00:00
hallgren
d2d57a9210 haskell-bind.cabal: relax overly restrictive version bounds and add cc-options 2014-01-17 14:18:20 +00:00
hallgren
045eeeb280 haskell-bind: add a cabal file and examples/pgf-shell.hs
* The haskell-bind.cabal file makes it easy to build the haskell binding and
  use it in ghci.
* pgf-shell.hs is a simple example of how to use the haskell binding.
2014-01-17 14:02:35 +00:00
hallgren
b0a40d82b9 haskell-bind: change the type of CRuntimeFFI.getConcr
Change the type of getConcr from

    getConcr :: PGF -> Language -> Concr

to

    getConcr :: PGF -> Language -> Maybe Concr

This is to prevent programs from crashing later if you try to select a
concrete syntax that is not present in a grammar.
2014-01-17 13:58:48 +00:00
kr.angelov
a01e248ae6 make sure that pgf_concrete_load has no effect on grammars that are completely loaded 2013-12-17 13:57:16 +00:00
hallgren
e0481e3b8a Add backward compatibility for reading old PGF files
Some backwards incompatible changes were made to the PGF file format after
the release of GF 3.5. This patch adds a module for reading PGF files in the
old format.

This means that old PGF files on the grammaticalframework.org server will
continue to work after we install the latest version of GF.
2013-12-17 13:27:37 +00:00
kr.angelov
0851308099 move src/runtime/haskell/CRuntimeFFI to src/runtime/haskell-bind. Don't mess up with the stable Haskell runtime! 2013-12-10 16:11:47 +00:00
kr.angelov
97d56065c4 load/unload in the Java binding 2013-12-10 16:06:34 +00:00
inari
d7847f2f13 Haskell bindings for the C runtime
Added Haskell bindings for the C runtime. Work in progress, the files are not (and should not be) included in makefiles or anything.
2013-12-10 15:27:28 +00:00
kr.angelov
0ece8f19ab loading and unloading of languages in the C runtime and in the Python bindings 2013-12-10 15:00:52 +00:00
kr.angelov
4f0246cc12 bugfix in the grammar splitter 2013-12-10 12:31:40 +00:00
kr.angelov
87fffffbdf option --split-pgf replaces option --mk-index. This splits the PGF into one file for the abstract and one more for each concrete syntax. This is a preparation for being able to load only specific languages from the whole grammar. 2013-12-10 10:43:13 +00:00
kr.angelov
1067d59609 -optimize-pgf should also apply to the linrefs 2013-11-29 14:25:23 +00:00
kr.angelov
f5ec987c5d better dictionary visualization in the Android App 2013-11-27 22:16:05 +00:00
kr.angelov
b0a74ddc59 added API in the C runtime and the Java binding for checking whether a given function is linearizable in a given language. This is used in the Android UI for better vizualizations 2013-11-27 12:35:11 +00:00
kr.angelov
eeec31cbab update the project files for the Java binding 2013-11-27 12:34:33 +00:00
kr.angelov
7a428198c6 space leak in the Java binding 2013-11-27 12:34:06 +00:00
hallgren
3f57151cc3 Represent identifiers as UTF-8-encoded ByteStrings
This was a fairly simple change thanks to previous work on making the Ident
type abstract and the fact that PGF.CId already uses UTF-8-encoded
ByteStrings.

One potential pitfall is that Data.ByteString.UTF8 uses the same type for
ByteStrings as Data.ByteString. I renamed ident2bs to ident2utf8 and
bsCId to utf8CId, to make it clearer that they work with UTF-8-encoded
ByteStrings.

Since both the compiler input and identifiers are now UTF-8-encoded
ByteStrings, the lexer now creates identifiers without copying any characters.
**END OF DESCRIPTION***

Place the long patch description above the ***END OF DESCRIPTION*** marker.
The first line of this file will be the patch name.


This patch contains the following changes:

M ./src/compiler/GF/Compile/CheckGrammar.hs -3 +3
M ./src/compiler/GF/Compile/GrammarToPGF.hs -2 +2
M ./src/compiler/GF/Grammar/Binary.hs -5 +1
M ./src/compiler/GF/Grammar/Lexer.x -11 +13
M ./src/compiler/GF/Infra/Ident.hs -19 +36
M ./src/runtime/haskell/PGF.hs -1 +1
M ./src/runtime/haskell/PGF/CId.hs -2 +3
2013-11-26 16:12:03 +00:00
kr.angelov
8bcc70eac8 the GF syntax for identifiers is exteded with quoted forms, i.e. you could write for instance 'ab.c' and then everything between the quites is identifier. This includes Unicode characters and non-ASCII symbols. This is useful for automatically generated GF grammars. 2013-11-22 13:30:18 +00:00
kr.angelov
1d2786f7da bugfix in the debug mode for the parser 2013-11-22 12:26:49 +00:00
kr.angelov
aad6a1c4bb bugfix in the C runtime 2013-11-21 14:31:28 +00:00
kr.angelov
a50724ca2c the Java binding for lookupMorpho should release the local references created in a loop 2013-11-21 14:29:47 +00:00
kr.angelov
9a2725279e fix in the Python binding 2013-11-20 09:54:37 +00:00
kr.angelov
5b83da5583 bugfix in the robust parser 2013-11-18 09:05:27 +00:00
kr.angelov
edb4f7320d add gu_buf_insert in libgu 2013-11-18 09:05:09 +00:00
kr.angelov
a6d60f9c8d fixes in the C runtime to avoid warnings when compiling on MacOS 2013-11-15 10:03:22 +00:00
kr.angelov
d997df2864 pgf_read should open the grammar file in binary mode to prevent the Windows runtime from messing up the content. 2013-11-15 09:04:00 +00:00
kr.angelov
b3149b7897 pgf_reader_done should do nothing if the reading has failed 2013-11-15 08:59:18 +00:00
kr.angelov
2dadc3aa4c add additional options for compiling the Java binding on Windows (suggested by Normunds) 2013-11-15 07:48:02 +00:00
kr.angelov
126d5e0278 bugfix in the C runtime which had made the parser up to 200 times slower for some sentences 2013-11-13 15:15:28 +00:00
kr.angelov
0095119ec0 added Predef.SOFT_BIND. This special token allows zero or more spaces between ordinary tokens. It is also used in the English RGL to attach the commas to the previous word. 2013-11-12 09:54:57 +00:00