203 Commits

Author SHA1 Message Date
hallgren
507b52cc23 gf.cabal: include PGF.Haskell 2015-01-14 14:53:28 +00:00
hallgren
9235f49ab3 gf.cabal: include editor modes in the list of data files to install
Also add ghc-7.8.3 to the list of tested compiler versions
2014-12-15 15:16:50 +00:00
hallgren
2eaf46f610 Work in progress on translating linearization functions to Haskell
The translation is currently good enough to translate all concrete syntaxes
of the Foods and Letter grammars, and some concrete syntaxes of the Phrasebook
grammar (e.g. PhrasebookEng & PhrasebookSpa works, but there are problems with
e.g. PhrasebookSwe and PhrasebookChi)

This functionality is enabled by running

	gf -make -output-format=haskell -haskell=concrete ...

TODO:
	- variants
	- pre { ... }
	- eta expansion of linearization functions
	- record subtyping can still cause type errors in the Haskell code
	  in some cases
	- reduce code large tables
2014-12-11 16:08:36 +00:00
hallgren
33571ba44f Some work to improve the structure of the haddock documenation 2014-11-10 15:23:02 +00:00
hallgren
ad36dbc0ed gf.cabal: when compiling with ghc>=7.8 require cgi>=3001.2.2.0 2014-11-05 15:38:10 +00:00
hallgren
0519493ca9 Use terminfo to highlight warnings and errors in blue and red
This replaces the hardwired ANSI escape codes that were accidentally included
in a previous patch.

This adds a dependency on terminfo, but this should be unproblematic, since
haskeline already depends on the same underlying C library.

The color highlighting is omitted on Windows.
2014-10-28 19:04:48 +00:00
hallgren
a9bc116052 Some small documentation improvements 2014-10-20 19:45:43 +00:00
hallgren
5a641ebe73 Rename src/programs/gf.hs to gf-main.hs to avoid confusing GHC
It appears that GHC can't keep GF.hs and gf.hs apart on systems with case
insensitive file names.
2014-10-16 15:21:00 +00:00
hallgren
2e2e7acf12 Turn the GF compiler into a library. Main program is now in src/programs/gf.hs
The module src/compiler/GF.hs now serves as a prelimiary compiler API. It just
exports a selection of functions and types from the compiler.

Haddock documentation can be generated with

	cabal haddock --hyperlink-source

Also bumbed the version number to 3.6.10.
2014-10-16 15:00:49 +00:00
hallgren
b70dba87ba Rename modules GFI, GFC & GFServer...
... to GF.Interactive, GF.Compiler & GF.Server, respectively.
2014-10-15 21:04:29 +00:00
hallgren
18ee232497 gf.cabal: add missing c-sources for the Haskell binding to the C run-time library 2014-09-11 11:53:07 +00:00
hallgren
a21ffc1941 gf.cabal, gf-server.cabal: add version bounds on network & httpd-shed
* httpd-shed-0.4 does not specify an upper bound on network, but it fails
  to build against network>=2.6. This is fixed in httpd-shed-0.4.0.2.
* With network-2.6, the Network.URI modules is moved to a separate package,
  so for the time being GF requires network>=2.3 && <2.6. This is compatible
  with the four most recent versions of the Haskell Platform.
2014-09-03 15:40:26 +00:00
hallgren
883d1ae21c gf.cabal ghc-options: don't force -j, -auto-all has been renamed to -fprof-auto 2014-08-25 23:30:22 +00:00
kr.angelov
584d589041 a partial support for def rules in the C runtime
The def rules are now compiled to byte code by the compiler and then to
native code by the JIT compiler in the runtime. Not all constructions
are implemented yet. The partial implementation is now in the repository
but it is not activated by default since this requires changes in the
PGF format. I will enable it only after it is complete.
2014-08-11 10:59:10 +00:00
Sergei Trofimovich
7eaea44386 gf.cabal: fix depend in --flags=-custom-binary case
Detected when building today:

Building gf-3.6...
Preprocessing library gf-3.6...

src/runtime/haskell/PGF/Internal.hs:17:8:
    Could not find module ‘Data.Binary.IEEE754’
    It is a member of the hidden package ‘data-binary-ieee754-0.4.4’.
    Perhaps you need to add ‘data-binary-ieee754’ to the build-depends in your .cabal file.
2014-07-25 14:41:11 +00:00
hallgren
0715cfe2ae minibar: include the grammar's last modification in the grammar info shown by the "i" button
Also bumped version number in gf.cabal to 3.6-darcs.
Also removed some unecessary use of CPP.
2014-06-24 13:59:09 +00:00
hallgren
89eb3fd60a Update web pages and bump version number to 3.6! 2014-06-21 18:29:29 +00:00
hallgren
c1eb47a67a gf.cabal: add a maintainer field 2014-06-17 20:55:13 +00:00
hallgren
d6252d1c16 PGF library: expose only PGF and PGF.Internal instead of all modules
PGF exports the public, stable API.
PGF.Internal exports additional things needed in the GF compiler & shell,
including the nonstardard version of Data.Binary.
2014-06-12 14:43:18 +00:00
hallgren
04e7bdb6fe Two improvements in the pgf-shell example
1. Like pgf-translate, it now shows one result at a time, press Enter to get
   more results.
2. You can load a new grammar with the command 'i <path-to-pgf>'
2014-05-07 16:37:28 +00:00
hallgren
570a417615 gf.cabal: require base>=4.3
This makes it explicit that we no longer support compiling GF with GHC 6.12
(which is 4 years old and comes with base-4.2).
2014-04-22 14:38:33 +00:00
hallgren
a2c25e88d4 gf.cabal: add GF builtin default -K64M. Enable parallel compile with ghc>=7.8
+ Programs compiled with ghc<7.8 have a default built-in 8M stack size limit.
  With ghc>7.0 this built-in default can be changed, so it is now 64M, allowing
  GF to work with larger grammars without manually increasing the stack size.
  (But if GF is compiled with ghc 6.12, the built-in default is still 8M.)

+ Enable ghc>=7.8 support for compiling modules in parallel, to speed up the
  compilation of GF.
2014-04-22 12:43:24 +00:00
hallgren
9cac98a356 Move basic lexing functions from GF.Text.Lexing to the new module PGF.Lexing
They are thus part of the PGF Run-Time Library, making it possible to add
lexing functionality in PGF service in a natural way.
2014-04-08 14:07:49 +00:00
hallgren
76ba865c2e Three fixes for compatibility with GHC 7.8
Two of the fixes were in the custom version of the binary package. We
should get rid of it at some point, to reduce the maintenance burden.

The third fix was to add new version constraints for happy and alex in
gf.cabal. New versions of them are needed because of the ugly, low-level,
GHC-specific code they produce need to be different for GHC 7.8.

More fixes might be needed for -server mode, but the cgi package is not
compatible with GHC 7.8 at the moment, so it will have to wait.
2014-03-04 14:13:41 +00:00
hallgren
60980d1617 Fix broken C runtime support in gf.cabal and PGFService.hs
Also add PGF service command c-flush to explicitly flush cached parse results
from memory.
2014-02-10 16:04:40 +00:00
hallgren
1d69feac38 gf.cabal: pgf-shell needs containers now 2014-02-07 16:42:51 +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
hallgren
c97e5f4086 gf.cabal: add default-language to silence warning 2014-02-03 12:24:42 +00:00
hallgren
77150e0b27 gf.cabal: bump version number to 3.5.12 2014-01-21 16:30:01 +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
d8d78b6187 Release note updates and some other minor things 2013-12-18 16:22:59 +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
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
hallgren
f5cda1e6a3 testsuite: Use Cabal's new test suite interface
* The old way: a user hook in Setup.hs
  * The new way: specify it in gf.cabal
  * The test suite is now called gf-tests, and it runs testsuite/run.hs.
  * You can run it manually with 'runhaskell testsuite/run.hs'. It also runs,
    together with rgl-tests, when you do 'cabal test'
  * Currently only 9 of 34 tests pass. Many failures have silly causes:
    - Error messages that look slightly different
    - Same output but in a different order
    - Absolute paths in output
2013-12-03 17:13:39 +00:00
hallgren
7d1c011389 Commment code and options relating to the old partial evaluator
This means that the -old-comp and -new-comp flags are not recognized anymore.

The only functional difference is that printnames were still normalized with
the old partial evaluator. Now that is done with the new partial evaluator.
2013-11-29 16:26:49 +00:00
hallgren
9d7fdf7c9a Change how GF deals with character encodings in grammar files
1. The default encoding is changed from Latin-1 to UTF-8.

2. Alternate encodings should be specified as "--# -coding=enc", the old
   "flags coding=enc" declarations have no effect but are still checked for
   consistency.

3. A transitional warning is generated for files that contain non-ASCII
   characters without specifying a character encoding:

	"Warning: default encoding has changed from Latin-1 to UTF-8"

4. Conversion to Unicode is now done *before* lexing. This makes it possible
   to allow arbitrary Unicode characters in identifiers. But identifiers are
   still stored as ByteStrings, so they are limited to Latin-1 characters
   for now.

5. Lexer.hs is no longer part of the repository. We now generate the lexer
   from Lexer.x with alex>=3. Some workarounds for bugs in alex-3.0 were
   needed. These bugs might already be fixed in newer versions of alex, but
   we should be compatible with what is shipped in the Haskell Platform.
2013-11-25 21:12:11 +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
gregoire.detrez
57a48fea59 Add a test runner and a test suite fore the rgl
The test suite tests the French Bescherelle paradigms.
2013-11-21 09:55:30 +00:00
hallgren
48660c219a Make PGF.Tree internal
The only use of PGF.Tree outside the PGF library was in GF.Command.Commands,
and it was eliminated by using PGF.Expr directly instead.
PGF.Paraphrase still uses PGF.Tree.
2013-11-06 14:29:17 +00:00
hallgren
7a41b45f13 Remove PGF.Signature
This module should not be part of the public PGF library API, and it was only
used in GF.CompileToAPI, so the code was moved there. The module defined
constFuncs and syntaxFuncs, but only syntaxFuncs was used.
2013-11-06 13:27:29 +00:00
hallgren
3814841d7d Eliminate mutual dependencies between the GF compiler and the PGF library
+ References to modules under src/compiler have been eliminated from the PGF
  library (under src/runtime/haskell). Only two functions had to be moved (from
  GF.Data.Utilities to PGF.Utilities) to make this possible, other apparent
  dependencies turned out to be vacuous.

+ In gf.cabal, the GF executable no longer directly depends on the PGF library
  source directory, but only on the exposed library modules. This means that
  there is less duplication in gf.cabal and that the 30 modules in the
  PGF library will no longer be compiled twice while building GF.

  To make this possible, additional PGF library modules have been exposed, even
  though they should probably be considered for internal use only. They could
  be collected in a PGF.Internal module, or marked as "unstable", to make
  this explicit.

+ Also, by using the -fwarn-unused-imports flag, ~220 redundant imports were
  found and removed, reducing the total number of imports by ~15%.
2013-11-05 13:11:10 +00:00
kr.angelov
74357cdedf fix in gf.cabal. Data.Binary.IEEE754 needs to be in the other-modules list for the PGF library since otherwise building GF applications will fail 2013-11-05 09:42:22 +00:00
hallgren
83a10ce25a Add a cabal flag to use the standard binary package
The standard binary package has improved efficiency and error handling [1], so
in the long run we should consider switching to it. At the moment, using it is
possible but not recommended, since it results in incomatible PGF files.

The modified modules from the binary package have been moved from
src/runtime/haskell to src/binary.

[1] http://lennartkolmodin.blogspot.se/2013/03/binary-07.html
2013-10-31 15:43:12 +00:00
hallgren
83283b0d6a Fix an old name shadowing bug in concrete syntax by removing the refresh pass
The refresh pass does not correctly keep track of the scope of local variables
and can convert things like \x->(\x->x) x into \x1->(\x2->x2) x2. Fortunately,
it appears that the refresh pass is not needed anymore, so it has been removed.
2013-09-09 14:29:57 +00:00
hallgren
d626a194de gf.cabal: version: 3.5-darcs 2013-09-02 20:27:47 +00:00
hallgren
824fbee593 Update to version 3.5 in gf.cabal and debian/changelog 2013-08-06 15:42:57 +00:00
hallgren
ecfcaa5395 Adding download page and release notes for the next release of GF
The suggested next release is 3.4.8 in early August.
Feel free to add things in download/release-3.4.8.t2t.
2013-07-29 13:26:22 +00:00
hallgren
078edf3e6b gf.cabal: fix tab char problem 2013-04-02 14:53:15 +00:00
hallgren
eb3fc960d5 gf.cabal: gf depends on utf8-string even when compiled without server support 2013-04-02 14:50:01 +00:00
Sergei Trofimovich
0173b5f4ff ghc-7.6: allow directory-1.2
Get rid of old-time depend (and ClockTime in favour of UTCTime).
time-compat helps to retain backward compatibility with directory-1.1
and lower.
2013-03-09 21:38:43 +00:00