summaryrefslogtreecommitdiff
path: root/src/compiler/GF
AgeCommit message (Collapse)Author
2013-04-19fix the command options for the vd command in the shellkr.angelov
2013-04-10gf -s/-q now silences "no linearization of" warningshallgren
2013-04-08PGF.hs: export function missingLinshallgren
Also in Commands.hs: be explicit about things imported from the PGF library that are not in the public API. Also a couple of haddock documentation fixes.
2013-04-05Compiler.hs: ghc 7.6.2 compatibilityhallgren
2013-04-03Prevent Unicode characters in warning messages from stopping grammar compilationhallgren
When compiling a grammar containing characters that are not supported in the current locale, warning messages could cause GF fail with hPutChar: invalid argument (Invalid or incomplete multibyte or wide character) With this quick fix, warning messages that can not be displayed are silently truncated instead, and compilation continues.
2013-03-29option pt -funs to show all fun's in a treeaarne
2013-03-16Fix a problem with pattern macros in pre { } expressionshallgren
The old partial evaluator has special rules to convert pattern macros in pre { } expressions. These rules were missing in the new partial evaluator.
2013-03-13pt -nub to remove duplicate trees from a list returned e.g. by a parseraarne
2013-03-12partial evaluator: push predefined functions inside variantshallgren
This should prevent errors like Internal error in Compute.ConcreteNew: Applying Predef.drop: Expected a value of type String, got VFV [VString "gewandt",VString "gewendet"]
2013-03-12command pt -subtrees that analyses a tree into the set of subtrees. Using pt ↵aarne
-subtrees <bigtree> | l -treebank for debugging the lin of a big tree
2013-03-11Additional changes for GHC 7.4 & 7.6 compatibilityhallgren
2013-03-09ghc-7.6: allow directory-1.2Sergei Trofimovich
Get rid of old-time depend (and ClockTime in favour of UTCTime). time-compat helps to retain backward compatibility with directory-1.1 and lower.
2013-02-28Fix a bug that could cause "Prelude.head: empty list"hallgren
In Data.Operations, the function topoTest2 assumed too much about the form of the input, compared to the older function topoTest.
2013-02-28pattern match length estimation code simplicationhallgren
2013-02-27Faster regular expression pattern matching in the grammar compiler.hallgren
The sequence operator (x+y) was implemented by splitting the string to be matched at all positions and trying to match the parts against the two subpatterns. To reduce the number of splits, we now estimate the minimum and maximum length of the string that the subpatterns could match. For common cases, where one of the subpatterns is a string of known length, like in (x+"y") or (x + ("a"|"o"|"u"|"e")+"y"), only one split will be tried.
2013-02-27GF grammar pretty printer improvementshallgren
Allow line breaks in more places to make large terms more readable.
2013-02-12now the beam size for the statistical parser can be configured by using the ↵kr.angelov
flag beam_size in the top-level concrete module
2013-02-03pg -lexc now writes a list of multichar symbols and a title ("Root") for the ↵aarne
lexicon, as required by Xerox lexc
2013-01-29Better error message for unsupported token gluinghallgren
Instead of "Internal error in ...", you now get a proper error message with a source location and a function name.
2013-01-29Fix a bug with record extensionhallgren
Add a conversion rule for ({ l1 = e } ** x).l2 in PMCFG generation. (A rule for the symmetric case (x ** { l1 = e }).l2 was added some time ago.)
2013-01-28Quick fix to render some parser error messages from UTF-8-encoded source ↵hallgren
files correctly. The parser works on raw byte sequences read from source files. If parsing succeeds the raw byte sequences are converted to proper Unicode characters in a later phase. But the parser calls the function buildAnyTree, which can fail and generate error messages containing source code fragments, which might then containing raw byte sequences. To render these error messages correctly, they need to be converted in accordance with the coding flag in the source file. This is now done for UTF-8-encoded source files, but should ideally also be done for other character encodings. (Latin-1-encoded files never suffered from this problem, since raw bytes are proper Unicode characters in this case.)
2013-01-28Better error message for Predef.errorhallgren
+ Instead of "Internal error in ...", you now get a proper error message with a source location and a function name. + Also added some missing error value propagation in the partial evaluator. + Also some other minor cleanup and error handling fixes.
2013-01-28improved error message for overloading in case the given signature looks the ↵aarne
same as one of the expected ones: it shows full records rather than just lock fields.
2013-01-11partial evaluator: fix token glueing bughallgren
"a"+("b"++"c") was simplified to "bb"++"c" instead of "ab"++c.
2012-12-20bug fix in the new partial evaluatorhallgren
It can leave wildcard tables in their origial form, but it easy to handle them in the unfactor function in GeneratePMCFG.
2012-12-20added alltenses to the default search path (just like prelude)aarne
2012-12-19partial evaluator bug fixhallgren
It failed to delay table selection when the selector contains a run-time variable, causing "gf: Prelude.(!!): index too large" instead. Also: + Show better source locations on unexpected errors, to aid bug hunting. + Removed unused SourceGrammar argument to value2term.
2012-12-19GF.Grammar.Lookup: new function lookupResDefLochallgren
It's like lookupResDef but it includes a source location in the output.
2012-12-18partial evaluator bug fixhallgren
Int was missing from the list of predefined canonical constants.
2012-12-14The first prototype for exhaustive generation in the C runtime. The trees ↵kr.angelov
are always listed in decreasing probability order. There is also an API for generation from Python
2012-12-14Add language extension for ghc<7.4hallgren
FlexibleInstances does not imply TypeSynonymInstances, apparently.
2012-12-14More work on the new partial evaluatorhallgren
The work done by the partial evaluator is now divied in two stages: - A static "term traversal" stage that happens only once per term and uses only statically known information. In particular, the values of lambda bound variables are unknown during this stage. Some tables are transformed to reduce the cost of pattern matching. - A dynamic "function application" stage, where function bodies can be evaluated repeatedly with different arguments, without the term traversal overhead and without recomputing statically known information. Also the treatment of predefined functions has been reworked to take advantage of the staging and better handle partial applications.
2012-12-11partial evaluator workhallgren
* Evaluate operators once, not every time they are looked up * Remember the list of parameter values instead of recomputing it from the pattern type every time a table selection is made. * Quick fix for partial application of some predefined functions.
2012-12-10Compute.ConcreteNew: add missing case for variant functionshallgren
Also adding a test case in the test suite for this.
2012-12-06Compute.ConcreteNew: bug fix for indirectly defined pattern macroshallgren
More changes are probably needed to make pattern macros first class values. Also includes minor changes related to variants and error messages.
2012-12-02produce error message instead of failure of irrefutable pattern Ok ty_C in ↵aarne
GrammarToPGF, to help find compilation errors; the ones I've found are because an inherited abstract excludes something that the inherited concrete does not exclude.
2012-11-23Fix a prededence bug in GF grammar pretty printerhallgren
The pretty printer produced mkDet pre {"a"; "an" / vowel} Sg which is not accepted by the parser. The parser assigns pre { ... }, to prededence level 4, and this is now reflected in the pretty printer, so it prints mkDet (pre {"a"; "an" / vowel}) Sg (This caused a problem in GFSE since it parsers pretty printed grammars...)
2012-11-22better visualization of parse treespeter.ljunglof
2012-11-16new-comp: rewrite f (x|y) into (f x|f y)hallgren
With this change, all languages in molto/mgl/mixture except German and Polish can be compiled.
2012-11-14Add flag --document-root for user with gf --serverhallgren
This can make it easier to test cloud service updates before installing them.
2012-11-14GF usage message fixeshallgren
Change the command name from gfc to gf in the usage message header. Correct spelling of "overide" to "override" in -gf-lib-path description.
2012-11-13Adding a new experimental partial evalutatorhallgren
GF.Compile.Compute.ConcreteNew + two new modules contain a new partial evaluator intended to solve some performance problems with the old partial evalutator in GF.Compile.Compute.ConcreteLazy. It has been around for a while, but is now complete enough to compile the RGL and the Phrasebook. The old partial evaluator is still used by default. The new one can be activated in two ways: - by using the command line option -new-comp when invoking GF. - by using cabal configure -fnew-comp to make -new-comp the default. In this case you can also use the command line option -old-comp to revert to the old partial evaluator. In the GF shell, the cc command uses the old evaluator regardless of -new-comp for now, but you can use "cc -new ..." to invoke the new evaluator. With -new-comp, computations happen in GF.Compile.GeneratePMCFG instead of GF.Compile.Optimize. This is implemented by testing the flag optNewComp in both modules, to omit calls to the old partial evaluator from GF.Compile.Optimize and add calls to the new partial evaluator in GF.Compile.GeneratePMCFG. This also means that -new-comp effectively implies -noexpand. In GF.Compile.CheckGrammar, there is a check that restricted inheritance is used correctly. However, when -noexpand is used, this check causes unexpected errors, so it has been converted to generate warnings, for now. -new-comp no longer enables the new type checker in GF.Compile.Typeckeck.ConcreteNew. The GF version number has been bumped to 3.3.10-darcs
2012-11-08Eliminate warnings about deprecated use of catch and tryhallgren
This is also needed for compatibility with GHC 7.6.
2012-11-07GF.Grammar.PatternMatch: relax overly restrictive type signatureshallgren
2012-11-07Some changed/new utility functionshallgren
GF.Data.Utilities: Rename mapFst to apFst, mapSnd to apSnd. Add apBoth, mapFst, mapSnd, mapBoth. GF.Data.Operations: Remove onSnd (same as apSnd)
2012-11-05unicode4k-changedvirk.shafqat
2012-10-25GF.Grammar.Macros: add function collectPattOphallgren
collectPattOp :: (Patt -> [a]) -> Patt -> [a]
2012-10-24GF.Grammar.Macros: add function composPattOphallgren
For Patt, analogous to composOp for Term.
2012-10-24Compute.ConcreteNew: support variantshallgren
Also add a missing check for Predef values in apply.
2012-10-24GeneratePMCFG: prefix messages about "impossible" errors with 'Internal error:'hallgren
Just to make them easier to spot when wading through thousands of lines of warnings...