summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile
AgeCommit message (Collapse)Author
2019-09-20remove obsolete codekrangelov
2019-09-10GrammarToCanonical: bug fix: add missing case for EmptyThomas Hallgren
2019-07-10Minor renamings in JSON formatJohn J. Camilleri
2019-07-10Address @heatherleaf's suggestionsJohn J. Camilleri
2019-07-07Whitespace fixesJohn J. Camilleri
2019-07-07Finish compile to PGF JSON, including JSON schema for resulting format.John J. Camilleri
2019-07-03Finish JSON conversion for abstractJohn J. Camilleri
2019-07-03Start work on PGFtoJSON module. Add compiler flag `-f json`.John J. Camilleri
2019-06-30fully supported case-insensitive parsing/lookupkrangelov
2019-05-20reordered error message for 'no overload'; might be even better to show ↵Aarne Ranta
complete types
2019-04-25GF.Compile.CheckGrammar: discard bad 'lincat C = …' with a warningThomas Hallgren
e.g. if C is a fun and not a cat in the abstract syntax. Discarding bad lincats prevents GF from generating malformed PGFs that are rejected by the C run-time system. I also added code to reject bad lincats with an error, but I left it commented out since it seems a bit pedantic compared to GF's otherwise rather sloppy grammar checking.
2019-03-22GF.Compile.GrammarToCanonical: keep unreachable rows in tablesThomas Hallgren
since unreachable rows can become reachable after grammar transformation. Also export smart constructors for projection and selection.
2019-03-14GF.Compile.GrammarToCanonical: allow + in reg exps in pre { }Thomas Hallgren
2019-03-13GF.Grammar.Canonical: some Functor/Foldable/Traversable instancesThomas Hallgren
2019-03-07Expose GF.Grammar.Canonical + some refactoringThomas Hallgren
to make it available in other tools by depending on the gf package and importing it
2019-03-07Rename module GF.Compile.ConcreteToCanonical to GF.Compile.GrammarToCanonicalThomas Hallgren
2019-02-26replace aeson with jsonkrangelov
2019-02-21Need aeson>=1.3Thomas Hallgren
Also remove ununsed GF.Compile.PGFtoAbstract
2019-02-08enable export of canonical grammars to JSON and YAMLPeter Ljunglöf
2019-01-23Export of concrete syntax to Haskell now goes via Canonical GFThomas Hallgren
TODO: better treatment of Predef functions and record subtyping coercions
2019-01-22More work on the canonica_gf exportThomas Hallgren
+ Abstract syntax now is converted directly from the Grammar and not via PGF, so you can use `gf -batch -no-pmcfg -f canonical_gf ...`, to export to canonical_gf while skipping PMCFG and PGF file generation completely. + Flags that are normally copied to PGF files are now included in the caninical_gf output as well (in particular the startcat flag).
2019-01-17Adding -output-format canonical_gfThomas Hallgren
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...
2018-10-19Add {-# LANGUAGE GADTs -#} to the generated Haskell fileInari Listenmaa
2018-04-18Fixes for GHC 8.4.1 compatibilityThomas Hallgren
* In GHC 8.4.1, the operator <> has become a method of the Semigroup class and is exported from the Prelude. This is unfortunate, since <> is also exported from the standard library module Text.PrettyPrint, so in any module that defines a pretty printer, there is likely to be an ambiguity. This affects ~18 modules in GF. Solution: import Prelude hiding (<>) This works also in older versions of GHC, since GHC does't complain if you hide something that doesn't exists. * In GHC 8.4.1, Semigroup has become a superclass of Monoid. This means that anywhere you define an instance of the Monoid class you also have to define an instance in the Semigroup class. This affects Data.Binary.Builder in GF. Solution: conditionally define a Semigroup instance if compiling with base>=4.11 (ghc>=8.4.1)
2018-01-23Remove "Warning: default encoding has changed from Latin-1 to UTF-8"Thomas Hallgren
The warning is about a change that was made in GF 3.6 (June 2014) and has probably outlived its purpose by now.
2017-09-29GF.Compile.Instructions is obsolete and now removedKrasimir Angelov
2017-09-07the experimental export to Lambda Prolog is now obsolete and is removedKrasimir Angelov
2017-09-06in Haskell GADT generation, hide Tree in the import of PGFAarne Ranta
2017-08-29added option -output-format=java for producing code for embedded grammars in ↵Krasimir Angelov
Java
2017-08-29the embedded grammars now work with both the pure Haskell and the Haskell ↵Krasimir Angelov
binding API
2017-03-22fixed a bug in Eq instance generation for GADT and lexical categoriesaarne
2017-03-07a better error messagekrasimir
2017-03-07GF.Compile.Compute.ConcreteNew now handles Predef.Floatkrasimir
2017-03-07bugfix in record subtyping checkingkrasimir
2017-03-07GF.Grammar.Printer now has a Terse mode which prints record types with lock ↵krasimir
fields with their corresponding abstract categories
2017-03-06fix for EPattkrasimir
2017-03-06type checking EPattkrasimir
2017-03-06GF.Compile.Compute.ConcreteNew now can handle EPattTypekrasimir
2017-03-06some missing patternskrasimir
2017-03-06added overload resolution in the experimental type checkerkrasimir
2017-03-03some progress on the experimental type checker for the concrete syntaxkrasimir
2017-02-24corrected fg generation for lexical categories, to avoid a type error in ↵aarne
generated code
2016-09-05BNF grammars (.bnf or .cf) can have rules without semicolons, as in the GF ↵aarne
book examples. However, if the grammar has any multiline rules, all of them must have semicolons.
2016-03-22CFGtoPGF is now extended to support context-free grammars with primitive ↵krasimir
parameters
2016-03-21initial support for BNFC syntax in context-free grammars for GF. Not all ↵krasimir
features are supported yet. Based on contribution from Gleb Lobanov
2016-03-21bugfix: GF.Compile.CFGtoPGF now supports literal categorieskrasimir
2016-03-15more progress on the typecheckerkrasimir
2016-03-07current state of the experimental typecheckerkrasimir
2016-03-03add missing cases in vapply in the partial evaluatorkrasimir
2016-03-02fix in the typecheckerkrasimir