summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile
AgeCommit message (Collapse)Author
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
2016-03-02a better interface between the type checker and the partial evaluatorkrasimir
2016-03-02the experimental type checker in GF.Compile.TypeCheck.ConcreteNew is now ↵krasimir
rewriten to use the complete evaluator in GF.Compile.Compute.ConcreteNew. The old sketchy implementation in GF.Compile.Compute.ConcreteNew1 is now removed.
2015-12-02GF shell, cc command: try to compute pre{...} tokens in token sequenceshallgren
This is implemented as a simple post-processing step after partial evaluation to try compute pre{...} tokens in token sequences. Nothing is done to deal with intervening free variants. This was done in response to a query from René T on the gf-dev mailing list.
2015-09-30cc -trace: don't try to show the bodies of lambda abstractionshallgren
This triggers evaluation of terms with free variables, which the partial evaluator isn't equipped to handle. Reported by Aarne.
2015-09-28Preliminary new shell feature: cc -trace.hallgren
You can now do things like cc -trace mkV "debug" to see a trace of all opers with their arguments and results during the computation of mkV "debug".
2015-08-28Comment out some dead code found with -fwarn-unused-bindshallgren
Also fixed some warnings and tightened some imports
2015-06-23Bump version of .gfo and .pgf files, improve error messages on version mismatchhallgren
Becacuse of the new special tokens added to the Symbol type, .gfo and .pgf files produced with the current version of GF can not always be used with older versions of GF and the PGF run-time system. The PGF version number was increased from (2,0) to (2,1). GF can still read version (2,0) and (1,0), so old PGF files continue to work. The GFO version was increased from "GF03" to "GF04".
2015-05-11added all orthographic primitiveskrasimir
2015-04-14Translating linearization functions to Haskell: move Haskell AST and pretty ↵hallgren
printer to GF.Haskell For further separation of pretty printing concerns from conversion concerns, the Haskell AST and pretty printer has been moved to its own module, GF.Haskell, also allowing it to be reused in other places where Haskell code is generated.
2015-04-07GF.Compile.ConcreteToHaskell: some documentationhallgren
2015-03-05remove some more old codekrasimir
2015-03-05removed some operations in GeneratePMCFG. They didn't work well with ↵krasimir
variants and are now obsolete with the new partial evaluator
2015-03-04GF.Compile.Compute.ConcreteNew: add dynamic table conversionhallgren
If the enumaration of table parameter values fails during the static traversal phase, try again in the dynamic computation phase, when the values of bound variables are known. This is necessary to properly deal with generic table construction in opers, like the ones found in prelude/Coordination.gf, e.g. consTable : (P : PType) -> ... = \P ... -> {s1 = table P {...} ; ... }
2015-03-04GF.Compile.Compute.ConcreteNew: some refactoring for readabilityhallgren
2015-03-02Fix to avoid "error (no reason given) OCCURRED IN optimizing <cat>"hallgren
GF.Compile.Optimize.mkLinReference can fail and cause this error because the helper function inside it applies msum to a list that might be empty (if there is a record type that does not contain a field of type Str). This means that it can return mzero::Err, i.e. Bad "error (no reason given)" which can slip through the top level test that only catches Bad "no string".
2015-02-20added option -plus-as-bind which treats (+) as a bind when used with runtime ↵krasimir
variables
2015-02-16Changes for compatibility with ghc-7.10-rc2hallgren
2 modules: Name clashes caused by Applicative-Monad change in Prelude 2 modules: Ambiguities caused by Foldable/Traversable in Prelude 2 modules: Backwards incompatible changes in time-1.5 for defaultTimeLocale 9 modules: {-# LANGUAGE FlexibleContexts #-} (because GHC checks inferred types now, in addition to explicitly given type signatures) Also silenced warnings about tab characters in source files.
2015-02-12Translating linearization functions to Haskell: more simplificationshallgren
+ Some additional simplifying rewrites. + Use an intermediate representation for Haskell types, for separation of concerns and cleaner code. + Pretty printer layout tuning + Code cleanup.
2015-02-11Translating linearization functions to Haskell: simplify the generated ↵hallgren
Haskell code Introduced an intermediate representation for the generated Haskell expressions. This allows pretty printing concerns to be separated from conversion concerns, and makes it easy to apply some simplifying rewrites to the generated expressions, e.g. [x] ++ [y] ==> [x,y] pure f <*> x ==> f <$> x f <$> pure x ==> pure (f x) join (pure x) ==> x
2015-02-09Translating linearization functions to Haskell: support for variantshallgren
By adding the flag -haskell=variants to the command line, GF will now generate linearization functions in Haskell that support variants. Variants are represented as lists in Haskell. Variants inside pre { ... } expressions are still ignored. TODO: apply some monad laws to generate more compact code (using an intermediate representation of the generated Haskell code, instead of pretty printing directly from the GF code).
2015-01-19Translating linearization functions to Haskell: move a common record type to ↵hallgren
PGF.Haskell Move the Haskell representation of the common linearization type {s:T} to the shared module PGF.Haskell, so that the same overloaded projection function proj_s can be used for all concrete syntaxes.
2015-01-14Translating linearization functions to Haskell: better treatment of special ↵hallgren
tokens Common code has been lifted out from the generated Haskell modules to an auxiliary module PGF.Haskell, which is currently included in the regular PGF library, although it is independent of it and probably belongs in a separate library. The type Str used by linearization functions is now based on a token type Tok, which is defined in PGF.Haskell. PGF.Haskell.Tok is similar to the type GF.Data.Str.Tok, but it has constructors for the special tokens BIND, SOFT_BIND and CAPIT, and there is a function fromStr :: Str -> String that computes the effects of these special tokens.
2015-01-08Translating linearization functions to Haskell: add support for pre {...}hallgren
STILL TODO: - variants - better treatment of special tokens BIND, SOFT_BIND & CAPIT.
2015-01-07Translating linearization functions to Haskell: use qualified names to avoid ↵hallgren
name clashes All languages in the Phasebook can now be converted to compilable Haskell code. STILL TODO: - variants - pre { ... }
2015-01-06Translating linearization functions to Haskell: significant code size reductionshallgren
+ Instead of including lists of parameter values generated by GF, generate code to enumerate parameter values (in the same order as GF). This seems to give a factor of 2-3 code size reduction in the Phrasebook (e.g. from 84MB to 25MB for Hin, from 338MB to 154MB for Fre). + Deduplicate table entries, i.e. convert "table [..,E,..,E,..,E,..]" into "let x = E in table [..,x,..,x,..,x,..]". This gives even more significant code size reduction in some cases, e.g. from 569MB to 15MB for PhrasebookFin. All phrasebook languages can now be converted to compilable Haskell code, except PhrasebookPes, which still has the name clash problem.
2015-01-06More work on translating linearization functions to Haskellhallgren
Many Phrasebook languages can now be converted to compilable Haskell code. Some languages (Fre, Hin, Snd, Urd) generate too much Haskell code to be practically useful (e.g. 338MB for Fre). One language (Fin) took too long to convert to Haskell. One language (Pes) has problems with name clashes in the generated Haskell code. STILL TODO: - variants - pre { ... } - reduce code duplication for large tables - generate qualified names to avoid name clashes
2014-12-11Work in progress on translating linearization functions to Haskellhallgren
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-08Haddock documentation: expose exportPGF, some other small improvementshallgren