mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
This output format converts a GF grammar to a "canonical" GF grammar. A canonical GF grammar consists of - one self-contained module for the abstract syntax - one self-contained module per concrete syntax The concrete syntax modules contain param, lincat and lin definitions, everything else has been eliminated by the partial evaluator, including references to resource library modules and functors. Record types and tables are retained. The -output-format canonical_gf option writes canonical GF grammars to a subdirectory "canonical/". The canonical GF grammars are written as normal GF ".gf" source files, which can be compiled with GF in the normal way. The translation to canonical form goes via an AST for canonical GF grammars, defined in GF.Grammar.Canonical. This is a simple, self-contained format that doesn't cover everyting in GF (e.g. omitting dependent types and HOAS), but it is complete enough to translate the Foods and Phrasebook grammars found in gf-contrib. The AST is based on the GF grammar "GFCanonical" presented here: https://github.com/GrammaticalFramework/gf-core/issues/30#issuecomment-453556553 The translation of concrete syntax to canonical form is based on the previously existing translation of concrete syntax to Haskell, implemented in module GF.Compile.ConcreteToHaskell. This module could now be reimplemented and simplified significantly by going via the canonical format. Perhaps exports to other output formats could benefit by going via the canonical format too. There is also the possibility of completing the GFCanonical grammar mentioned above and using GF itself to convert canonical GF grammars to other formats...
354 lines
8.0 KiB
Plaintext
354 lines
8.0 KiB
Plaintext
name: gf
|
|
version: 3.10
|
|
|
|
cabal-version: >= 1.22
|
|
build-type: Custom
|
|
license: OtherLicense
|
|
license-file: LICENSE
|
|
category: Natural Language Processing, Compiler
|
|
synopsis: Grammatical Framework
|
|
description: GF, Grammatical Framework, is a programming language for multilingual grammar applications
|
|
homepage: http://www.grammaticalframework.org/
|
|
bug-reports: https://github.com/GrammaticalFramework/gf-core/issues
|
|
maintainer: Thomas Hallgren
|
|
tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.3
|
|
|
|
data-dir: src
|
|
data-files:
|
|
www/*.html
|
|
www/*.css
|
|
www/P/*.png
|
|
www/gfse/*.html
|
|
www/gfse/*.css
|
|
www/gfse/*.js
|
|
www/gfse/P/*.png
|
|
www/gfse/P/*.jpg
|
|
www/js/*.js
|
|
www/minibar/*.html
|
|
www/minibar/*.css
|
|
www/minibar/*.js
|
|
www/minibar/*.png
|
|
www/syntax-editor/*.html
|
|
www/syntax-editor/*.css
|
|
www/syntax-editor/*.js
|
|
www/TransQuiz/*.html
|
|
www/TransQuiz/*.css
|
|
www/TransQuiz/*.js
|
|
www/TransQuiz/*.png
|
|
www/translator/*.html
|
|
www/translator/*.css
|
|
www/translator/*.js
|
|
|
|
custom-setup
|
|
setup-depends:
|
|
base,
|
|
Cabal >=1.22.0.0,
|
|
directory,
|
|
filepath,
|
|
process >=1.0.1.1
|
|
|
|
source-repository head
|
|
type: git
|
|
location: https://github.com/GrammaticalFramework/gf-core.git
|
|
|
|
flag interrupt
|
|
Description: Enable Ctrl+Break in the shell
|
|
Default: True
|
|
|
|
flag server
|
|
Description: Include --server mode
|
|
Default: True
|
|
|
|
flag network-uri
|
|
description: Get Network.URI from the network-uri package
|
|
default: True
|
|
|
|
--flag new-comp
|
|
-- Description: Make -new-comp the default
|
|
-- Default: True
|
|
|
|
flag c-runtime
|
|
Description: Include functionality from the C run-time library (which must be installed already)
|
|
Default: False
|
|
|
|
Library
|
|
default-language: Haskell2010
|
|
build-depends: base >= 4.6 && <5,
|
|
array,
|
|
containers,
|
|
bytestring,
|
|
utf8-string,
|
|
random,
|
|
pretty,
|
|
mtl,
|
|
exceptions
|
|
hs-source-dirs: src/runtime/haskell
|
|
|
|
other-modules:
|
|
-- not really part of GF but I have changed the original binary library
|
|
-- and we have to keep the copy for now.
|
|
Data.Binary
|
|
Data.Binary.Put
|
|
Data.Binary.Get
|
|
Data.Binary.Builder
|
|
Data.Binary.IEEE754
|
|
|
|
--ghc-options: -fwarn-unused-imports
|
|
--if impl(ghc>=7.8)
|
|
-- ghc-options: +RTS -A20M -RTS
|
|
ghc-prof-options: -fprof-auto
|
|
if impl(ghc>=8.6)
|
|
Default-extensions: NoMonadFailDesugaring
|
|
|
|
exposed-modules:
|
|
PGF
|
|
PGF.Internal
|
|
PGF.Haskell
|
|
|
|
other-modules:
|
|
PGF.Data
|
|
PGF.Macros
|
|
PGF.Binary
|
|
PGF.Optimize
|
|
PGF.Printer
|
|
PGF.CId
|
|
PGF.Expr
|
|
PGF.Generate
|
|
PGF.Linearize
|
|
PGF.Morphology
|
|
PGF.Paraphrase
|
|
PGF.Parse
|
|
PGF.Probabilistic
|
|
PGF.SortTop
|
|
PGF.Tree
|
|
PGF.Type
|
|
PGF.TypeCheck
|
|
PGF.Forest
|
|
PGF.TrieMap
|
|
PGF.VisualizeTree
|
|
PGF.ByteCode
|
|
PGF.OldBinary
|
|
PGF.Utilities
|
|
|
|
if flag(c-runtime)
|
|
exposed-modules: PGF2
|
|
other-modules: PGF2.FFI PGF2.Expr PGF2.Type
|
|
GF.Interactive2 GF.Command.Commands2
|
|
hs-source-dirs: src/runtime/haskell-bind
|
|
build-tools: hsc2hs
|
|
extra-libraries: pgf gu
|
|
c-sources: src/runtime/haskell-bind/utils.c
|
|
cc-options: -std=c99
|
|
|
|
---- GF compiler as a library:
|
|
|
|
build-depends: filepath, directory, time, time-compat,
|
|
process, haskeline, parallel>=3
|
|
|
|
hs-source-dirs: src/compiler
|
|
exposed-modules:
|
|
GF
|
|
GF.Support
|
|
GF.Text.Pretty
|
|
GF.Text.Lexing
|
|
|
|
other-modules:
|
|
GF.Main GF.Compiler GF.Interactive
|
|
|
|
GF.Compile GF.CompileInParallel GF.CompileOne GF.Compile.GetGrammar
|
|
GF.Grammar
|
|
|
|
GF.Data.Operations GF.Infra.Option GF.Infra.UseIO
|
|
|
|
GF.Command.Abstract
|
|
GF.Command.CommandInfo
|
|
GF.Command.Commands
|
|
GF.Command.CommonCommands
|
|
GF.Command.SourceCommands
|
|
GF.Command.Help
|
|
GF.Command.Importing
|
|
GF.Command.Interpreter
|
|
GF.Command.Messages
|
|
GF.Command.Parse
|
|
GF.Command.TreeOperations
|
|
GF.Compile.CFGtoPGF
|
|
GF.Compile.CheckGrammar
|
|
GF.Compile.Compute.AppPredefined
|
|
GF.Compile.Compute.ConcreteNew
|
|
-- GF.Compile.Compute.ConcreteNew1
|
|
GF.Compile.Compute.Predef
|
|
GF.Compile.Compute.Value
|
|
GF.Compile.ExampleBased
|
|
GF.Compile.Export
|
|
GF.Compile.GenerateBC
|
|
GF.Compile.GeneratePMCFG
|
|
GF.Compile.GrammarToPGF
|
|
GF.Compile.Multi
|
|
GF.Compile.Optimize
|
|
GF.Compile.PGFtoHaskell
|
|
GF.Compile.PGFtoAbstract
|
|
GF.Compile.PGFtoJava
|
|
GF.Haskell
|
|
GF.Compile.ConcreteToHaskell
|
|
GF.Compile.ConcreteToCanonical
|
|
GF.Grammar.Canonical
|
|
GF.Compile.PGFtoJS
|
|
GF.Compile.PGFtoProlog
|
|
GF.Compile.PGFtoPython
|
|
GF.Compile.ReadFiles
|
|
GF.Compile.Rename
|
|
GF.Compile.SubExOpt
|
|
GF.Compile.Tags
|
|
GF.Compile.ToAPI
|
|
GF.Compile.TypeCheck.Abstract
|
|
GF.Compile.TypeCheck.Concrete
|
|
GF.Compile.TypeCheck.ConcreteNew
|
|
GF.Compile.TypeCheck.Primitives
|
|
GF.Compile.TypeCheck.RConcrete
|
|
GF.Compile.TypeCheck.TC
|
|
GF.Compile.Update
|
|
GF.Data.BacktrackM
|
|
GF.Data.ErrM
|
|
GF.Data.Graph
|
|
GF.Data.Graphviz
|
|
GF.Data.Relation
|
|
GF.Data.Str
|
|
GF.Data.Utilities
|
|
GF.Data.XML
|
|
GF.Grammar.Analyse
|
|
GF.Grammar.Binary
|
|
GF.Grammar.CFG
|
|
GF.Grammar.EBNF
|
|
GF.Grammar.BNFC
|
|
GF.Grammar.Grammar
|
|
GF.Grammar.Lexer
|
|
GF.Grammar.Lockfield
|
|
GF.Grammar.Lookup
|
|
GF.Grammar.Macros
|
|
GF.Grammar.Parser
|
|
GF.Grammar.PatternMatch
|
|
GF.Grammar.Predef
|
|
GF.Grammar.Printer
|
|
GF.Grammar.ShowTerm
|
|
GF.Grammar.Unify
|
|
GF.Grammar.Values
|
|
GF.Infra.BuildInfo
|
|
GF.Infra.CheckM
|
|
GF.Infra.Concurrency
|
|
GF.Infra.Dependencies
|
|
GF.Infra.GetOpt
|
|
GF.Infra.Ident
|
|
GF.Infra.Location
|
|
GF.Infra.SIO
|
|
GF.JavaScript.AbsJS
|
|
GF.JavaScript.PrintJS
|
|
GF.Quiz
|
|
GF.Speech.CFGToFA
|
|
GF.Speech.FiniteState
|
|
GF.Speech.GSL
|
|
GF.Speech.JSGF
|
|
GF.Speech.PGFToCFG
|
|
GF.Speech.PrRegExp
|
|
GF.Speech.RegExp
|
|
GF.Speech.SISR
|
|
GF.Speech.SLF
|
|
GF.Speech.SRG
|
|
GF.Speech.SRGS_ABNF
|
|
GF.Speech.SRGS_XML
|
|
GF.Speech.VoiceXML
|
|
GF.System.Catch
|
|
GF.System.Concurrency
|
|
GF.System.Console
|
|
GF.System.Directory
|
|
GF.System.Process
|
|
GF.System.Signal
|
|
GF.Text.Clitics
|
|
GF.Text.Coding
|
|
GF.Text.Transliterations
|
|
Paths_gf
|
|
|
|
if flag(c-runtime)
|
|
cpp-options: -DC_RUNTIME
|
|
|
|
if flag(server)
|
|
build-depends: httpd-shed>=0.4.0.3, network>=2.3 && <2.7, json,
|
|
cgi>=3001.2.2.0
|
|
if flag(network-uri)
|
|
build-depends: network-uri>=2.6, network>=2.6
|
|
else
|
|
build-depends: network<2.6
|
|
|
|
cpp-options: -DSERVER_MODE
|
|
other-modules:
|
|
GF.Server
|
|
PGFService
|
|
RunHTTP
|
|
SimpleEditor.Convert
|
|
SimpleEditor.JSON
|
|
SimpleEditor.Syntax
|
|
URLEncoding
|
|
CGI
|
|
CGIUtils
|
|
Cache
|
|
Fold
|
|
ExampleDemo
|
|
ExampleService
|
|
hs-source-dirs: src/server src/server/transfer src/example-based
|
|
|
|
if flag(interrupt)
|
|
cpp-options: -DUSE_INTERRUPT
|
|
other-modules: GF.System.UseSignal
|
|
else
|
|
other-modules: GF.System.NoSignal
|
|
|
|
if impl(ghc>=7.8)
|
|
build-tools: happy>=1.19, alex>=3.1
|
|
-- ghc-options: +RTS -A20M -RTS
|
|
else
|
|
build-tools: happy, alex>=3
|
|
|
|
ghc-options: -fno-warn-tabs
|
|
|
|
if os(windows)
|
|
build-depends: Win32
|
|
else
|
|
build-depends: unix, terminfo>=0.4
|
|
|
|
if impl(ghc>=8.2)
|
|
ghc-options: -fhide-source-paths
|
|
|
|
Executable gf
|
|
hs-source-dirs: src/programs
|
|
main-is: gf-main.hs
|
|
default-language: Haskell2010
|
|
build-depends: gf, base
|
|
ghc-options: -threaded
|
|
--ghc-options: -fwarn-unused-imports
|
|
|
|
if impl(ghc>=7.0)
|
|
ghc-options: -rtsopts -with-rtsopts=-I5
|
|
if impl(ghc<7.8)
|
|
ghc-options: -with-rtsopts=-K64M
|
|
|
|
ghc-prof-options: -auto-all
|
|
|
|
if impl(ghc>=8.2)
|
|
ghc-options: -fhide-source-paths
|
|
|
|
executable pgf-shell
|
|
--if !flag(c-runtime)
|
|
buildable: False
|
|
main-is: pgf-shell.hs
|
|
hs-source-dirs: src/runtime/haskell-bind/examples
|
|
build-depends: gf, base, containers, mtl, lifted-base
|
|
default-language: Haskell2010
|
|
if impl(ghc>=7.0)
|
|
ghc-options: -rtsopts
|
|
|
|
test-suite gf-tests
|
|
type: exitcode-stdio-1.0
|
|
main-is: run.hs
|
|
hs-source-dirs: testsuite
|
|
build-depends: base>=4.3 && <5, Cabal>=1.8, directory, filepath, process
|
|
default-language: Haskell2010
|