summaryrefslogtreecommitdiff
path: root/src/runtime/haskell
AgeCommit message (Collapse)Author
2015-02-12PGF.Haskell: adding operators for selections from tableshallgren
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.
2014-10-31now (+) in the abstract syntax works, i.e. it knows how to deal with partial ↵kr.angelov
sums
2014-10-30a more efficient tail call by using the new TUCK instructionkr.angelov
2014-10-26an explicit SAVE instructionkr.angelov
2014-10-22an explicit PUSH_FRAME instructionkr.angelov
2014-10-19(un)lexmixed: added the other math environments than $ used in latexaarne
2014-10-17one general case in dealing with backslash in latex lexing is enoughaarne
2014-10-17unlexing latex code: no space between closing $ and punctuationaarne
2014-10-17lexer for latex code: don't separate backslash from the macro name that it marksaarne
2014-10-16finally proper stack unwind in the evaluatorkr.angelov
2014-10-14the compiler now allows + to be used as a floating point addition in the ↵kr.angelov
abstract syntax
2014-10-09Prelude.CAPIT is now a built-in primitive. It still generates &| in the ↵kr.angelov
Haskell runtime but will be intepreted in the C runtime
2014-10-06using instruction RET was wrong; now use EVALkr.angelov
2014-09-29bugfix in the pattern matching compiler and a number of other fixes that I ↵kr.angelov
somehow did not push before
2014-09-11a major revision of the bytecode generator and JIT compiler. the effect is ↵kr.angelov
that now we can compute with lambda functions and with true tail recursion
2014-09-05the code for def rules now uses proper graph update to preserve lazynesskr.angelov
2014-09-05full support for recursive def rules in the C runtimekr.angelov
2014-09-01partial implementation for recursive def ruleskr.angelov
2014-08-13Fix warnings in 16 modules, mostly forward compatibility warnings from GHC 7.8hallgren
2014-08-11a partial support for def rules in the C runtimekr.angelov
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-07-15PGF Web Service: include entire completion in full modejohn.j.camilleri
When using full=yes in the web service 'complete' command, you now get an additional field 'seq' with the longest possible completion. So, given: lin f1 = ss "the" ; f2 = ss ("the red house" | "the real deal") ; and trying to complete on input "th", you get: [ { "from": "TestCnc", "brackets": { "cat": "_", "fid": 0, "index": 0, "fun": "_", "children": [] }, "text": "th", "completions": [ { "token": "the", "funs": [ { "fun": "f1", "hyps": [], "cat": "C", "seq": "the" }, { "fun": "f2", "hyps": [], "cat": "C", "seq": "the red house" }, { "fun": "f2", "hyps": [], "cat": "C", "seq": "the real deal" } ] } ] } ]
2014-07-11PGF web service: Return additional completion info with 'full' flagjohn
BETA! The 'complete' command now has a new flag 'full' which when set returns additional info about completions. Without 'full' flag (default): [ { "from": "PhrasebookEng", "brackets": { "cat": "_", "fid": 0, "index": 0, "fun": "_", "children": [ { "token": "the" } ] }, "text": "su", "completions": [ "supermarket", "suspect" ] } ] With full=true or full=yes: [ { "from": "PhrasebookEng", "brackets": { "cat": "_", "fid": 0, "index": 0, "fun": "_", "children": [ { "token": "the" } ] }, "text": "su", "completions": [ { "token": "supermarket", "funs": [ { "fid": 421, "fun": "Supermarket", "hyps": [], "cat": "PlaceKind" } ] }, { "token": "suspect", "funs": [ { "fid": 445, "fun": "Suspect", "hyps": [], "cat": "Property" } ] } ] } ]
2014-06-12PGF library: expose only PGF and PGF.Internal instead of all moduleshallgren
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-04-09Change the type of PGF.Lexing.bindTok to [String] -> [String]hallgren
The old type was [String] -> String. This function was only used in GF.Text.Lexing.stringOp, which now uses (unwords . bindTok) instead, with no change in behaviour.
2014-04-09Unlexers: move capitalization of first word from GF.Text.Lexing to PGF.Lexinghallgren
The capitalization of the first word was done in GF.Text.Lexing.stringOp, but is now done in the functions unlexText and unlexMixed in PGF.Lexing. These functions are only used in stringOp and in PGFService (where the change is needed), so the subtle change in behaviour should not cause any bugs.
2014-04-09PGF Service: a bit more clever lexer=texthallgren
Only change the first word to lowercase if the original input is not found in the grammar's morphology. This allows parsing of sentenses starting with "I" in English, nouns in German and proper names in other languages, but it can make the wrong choice for multi-words.
2014-04-08Move basic lexing functions from GF.Text.Lexing to the new module PGF.Lexinghallgren
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-03-12ensure that negative probabilities are always avoidedkr.angelov
2014-02-10Restore compatibility with GHC 7.0hallgren
2014-02-04PGF.Optimize: one more fix for unsafeFreezehallgren
2014-02-04PGF.Optimize: import unsafeFreeze from Data.Array.Unsafe for compatibility ↵hallgren
with ghc-7.8
2014-01-31fix in the bracketedLinearize in Haskellkr.angelov
2014-01-24fix in the Haskell runtimekr.angelov
2013-12-17Add backward compatibility for reading old PGF fileshallgren
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-10move src/runtime/haskell/CRuntimeFFI to src/runtime/haskell-bind. Don't mess ↵kr.angelov
up with the stable Haskell runtime!
2013-12-10Haskell bindings for the C runtimeinari
Added Haskell bindings for the C runtime. Work in progress, the files are not (and should not be) included in makefiles or anything.
2013-12-10bugfix in the grammar splitterkr.angelov
2013-12-10option --split-pgf replaces option --mk-index. This splits the PGF into one ↵kr.angelov
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-11-29-optimize-pgf should also apply to the linrefskr.angelov
2013-11-26Represent identifiers as UTF-8-encoded ByteStringshallgren
This was a fairly simple change thanks to previous work on making the Ident type abstract and the fact that PGF.CId already uses UTF-8-encoded ByteStrings. One potential pitfall is that Data.ByteString.UTF8 uses the same type for ByteStrings as Data.ByteString. I renamed ident2bs to ident2utf8 and bsCId to utf8CId, to make it clearer that they work with UTF-8-encoded ByteStrings. Since both the compiler input and identifiers are now UTF-8-encoded ByteStrings, the lexer now creates identifiers without copying any characters. **END OF DESCRIPTION*** Place the long patch description above the ***END OF DESCRIPTION*** marker. The first line of this file will be the patch name. This patch contains the following changes: M ./src/compiler/GF/Compile/CheckGrammar.hs -3 +3 M ./src/compiler/GF/Compile/GrammarToPGF.hs -2 +2 M ./src/compiler/GF/Grammar/Binary.hs -5 +1 M ./src/compiler/GF/Grammar/Lexer.x -11 +13 M ./src/compiler/GF/Infra/Ident.hs -19 +36 M ./src/runtime/haskell/PGF.hs -1 +1 M ./src/runtime/haskell/PGF/CId.hs -2 +3
2013-11-22the GF syntax for identifiers is exteded with quoted forms, i.e. you could ↵kr.angelov
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-12added Predef.SOFT_BIND. This special token allows zero or more spaces ↵kr.angelov
between ordinary tokens. It is also used in the English RGL to attach the commas to the previous word.
2013-11-06Remove PGF.Signaturehallgren
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-06the content of ParseEngAbs3.probs is now merged with ParseEngAbs.probs. The ↵kr.angelov
later is now retrained. Once the grammar is compiled with the .probs file now it doesn't need anything more to do robust parsing. The robustness itself is controlled by the flags 'heuristic_search_factor', 'meta_prob' and 'meta_token_prob' in ParseEngAbs.gf
2013-11-05linearization by chunks in the GF shell: a new command 'lc' needed because ↵aarne
'l' requires type checking and trees with metavariable function heads don't type check. This will hopefully be a temporary command.
2013-11-05Eliminate mutual dependencies between the GF compiler and the PGF libraryhallgren
+ 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-10-31Add a cabal flag to use the standard binary packagehallgren
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