1
0
forked from GitHub/gf-core

gf -cshell: preliminary support for the C run-time system in the GF shell

Some C run-time functionality is now available in the GF shell, by starting
GF with 'gf -cshell' or 'gf -crun'. Only limited functionality is available
when running the shell in these modes:

- You can only import .pgf files, not source files.
- The -retain flag can not be used and the commands that require it to work
  are not available.
- Only 18 of the 40 commands available in the usual shell have been
  implemented. The 'linearize' and 'parse' commands are the only ones
  that call the C run-time system, and they support only a limited set of
  options and flags. Use the 'help' commmands for details.
- A new command 'generate_all', that calls PGF2.generateAll, has been added.
  Unfortuntaly, using it causes 'segmentation fault'.

This is implemented by adding two new modules: GF.Command.Commands2 and
GF.Interactive2. They are copied and modified versions of GF.Command.Commands
and GF.Interactive, respectively. Code for unimplemented commands and other
code that has not been adapted to the C run-time system has been left in
place, but commented out, pending further work.
This commit is contained in:
hallgren
2015-08-10 14:12:51 +00:00
parent 97c6ffd462
commit 230d9780b7
7 changed files with 2007 additions and 13 deletions

View File

@@ -132,13 +132,14 @@ Library
PGF.OldBinary
if flag(c-runtime)
exposed-modules: PGF2
other-modules: PGF2.FFI
hs-source-dirs: src/runtime/haskell-bind
build-tools: hsc2hs
extra-libraries: gu pgf
c-sources: src/runtime/haskell-bind/utils.c
cc-options: -std=c99
exposed-modules: PGF2
other-modules: PGF2.FFI
GF.Interactive2 GF.Command.Commands2
hs-source-dirs: src/runtime/haskell-bind
build-tools: hsc2hs
extra-libraries: gu pgf
c-sources: src/runtime/haskell-bind/utils.c
cc-options: -std=c99
---- GF compiler as a library: