1
0
forked from GitHub/gf-core
Commit Graph

2961 Commits

Author SHA1 Message Date
kr.angelov
b367dfd80f a bit more flexible API for parsing in Python 2012-12-14 16:00:52 +00:00
kr.angelov
8aefd1e072 The first prototype for exhaustive generation in the C runtime. The trees are always listed in decreasing probability order. There is also an API for generation from Python 2012-12-14 15:32:49 +00:00
hallgren
79711380a2 Add language extension for ghc<7.4
FlexibleInstances does not imply TypeSynonymInstances, apparently.
2012-12-14 14:21:46 +00:00
hallgren
950832dbba More work on the new partial evaluator
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-14 14:00:21 +00:00
kr.angelov
e1bab39458 bugfix in the lexer from the C runtime. the input sentence doesn't have to terminate with whitespace 2012-12-13 16:45:44 +00:00
kr.angelov
6bc32db1c3 added simple error handling in the Python test 2012-12-13 16:44:39 +00:00
kr.angelov
81428c768c added a simple test for the Python binding 2012-12-13 16:19:56 +00:00
kr.angelov
cc7ea9260b an initial API for parsing and linearization from Python 2012-12-13 15:39:07 +00:00
kr.angelov
2ba632dc9f a top-level API for parsing in the C runtime 2012-12-13 14:44:33 +00:00
kr.angelov
60942c440a bugfix: the outside probability of a PgfItemConts must always be initialized to zero 2012-12-13 11:11:45 +00:00
kr.angelov
fe51a7fb98 bugfix: pgf_read_expr no longer requires a semicolon at the end of an abstract expression 2012-12-13 11:09:26 +00:00
kr.angelov
162fd5e512 an initial Python binding to the C runtime 2012-12-12 11:29:39 +00:00
kr.angelov
1376df457d started an official API to the C runtime 2012-12-12 11:25:58 +00:00
hallgren
f39466f787 partial evaluator work
* 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-11 15:37:41 +00:00
john.j.camilleri
60f8a6b647 Syntax editor: unwrap feature 2012-12-11 15:09:16 +00:00
john.j.camilleri
acd2f73c8c Syntax editor: link to about page 2012-12-11 09:48:44 +00:00
john.j.camilleri
64d463dddf Syntax editor: add about.html (and a Makefile for generating it) 2012-12-11 09:42:57 +00:00
kr.angelov
3182e382dc bugfix for robust parsing with multi-word units 2012-12-11 12:57:22 +00:00
hallgren
ab97deae57 Compute.ConcreteNew: add missing case for variant functions
Also adding a test case in the test suite for this.
2012-12-10 13:25:32 +00:00
john.j.camilleri
36d2f165ea Syntax editor: change startcat when wrapping top node 2012-12-07 15:32:31 +00:00
hallgren
e966a4ccc8 Make -new-comp the default and bump the version number to 3.3.11-darcs
* -new-comp (the new partial evaluator) is now chosen by default when you run
  cabal install (or cabal configure). To revert to using the old partial
  evaluator by default, use "cabal install -f-new-comp" (or
  "cabal configure -f-new-comp").

* Regardless of the configured default, you can choose which partial evaluator
  to use when you invoke gf by using the -new-comp or -old-comp command line
  option.

* The cc command in the GF shell uses the chosen partial evaluator by default,
  but you can override this by using "cc -new" or "cc -old".

The plan is that these flags will be romeved in a future version.
2012-12-07 14:01:42 +00:00
john.j.camilleri
fe2fb1c51b Syntax editor: various small improvements...
- separate tree edit buttons from option buttons
- fix bug when wrapping on freshly imported ast
- add interface for import & export of ast
- cleaner internal implementation of Editor.add_refinement
- small style updates
2012-12-07 12:55:17 +00:00
hallgren
7d0f649f29 Compute.ConcreteNew: bug fix for indirectly defined pattern macros
More changes are probably needed to make pattern macros first class values.
Also includes minor changes related to variants and error messages.
2012-12-06 16:44:03 +00:00
john.j.camilleri
44138ff8ce Syntax editor: wrap now handles multiple possible positions for subtree 2012-12-04 15:45:41 +00:00
john.j.camilleri
cf0051bbb3 Syntax editor: add wrap feature 2012-12-03 14:02:47 +00:00
kr.angelov
1863e4c3d6 added experimental script for chunking in the C runtime 2012-12-03 10:07:54 +00:00
kr.angelov
2da23e9872 added INSTALL file and updated README file for the C runtime 2012-12-03 09:09:08 +00:00
aarne
d34adff894 produce error message instead of failure of irrefutable pattern Ok ty_C in 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-12-02 19:40:45 +00:00
john.j.camilleri
596cd4d473 Syntax editor: internal optimizations by pre-computing certain stuff 2012-11-30 15:08:46 +00:00
john.j.camilleri
589e1e4f08 Syntax editor: in-place replacement of functions
When at a non-leaf node, refinements with identical type signatures
are highlighting and can re placed without destroying the children.
If not, the refinement is greyed and the user is asked to clear
the current subtree first if they wish to replace it.
This aspect of the UI should be polished, but at least it is obvious.
Also, some substantial optimizations can still be made to cache
the processed type signatures (which determine what can be replaced
in-place)
2012-11-30 10:56:42 +00:00
hallgren
7b87169c76 minibar: add a button to get detailed grammar info
After pressing the "i" button to view grammar info, there is now a
"More info" button to get more detailed information about all categories and
functions in the grammar.
2012-11-29 19:15:30 +00:00
hallgren
c9522c0a37 minibar: add tool tips to some of the buttons
Also move the functions title and attr from editor/editor.js to js/support.js.
Also mention recent changes in minibar/about.html.
2012-11-29 16:05:42 +00:00
john.j.camilleri
d9b0895e57 Syntax editor: internal improvements. re-introduce initialize_from function 2012-11-29 15:40:18 +00:00
john.j.camilleri
a2c0030415 Syntax editor/minibar integration fix 2012-11-29 15:18:02 +00:00
hallgren
a6ac00023d some documentation updates and fixes
doc/Makefile: add a rule to regenerate gf-help-full.txt
gf-help-full.txt: updated (new parse tree visualization options)
demo & cloud index: clarifications
minibar documentation: better layout on mobile devices
GF 3.4 release notes: reorganized & updated
2012-11-27 14:11:47 +00:00
john.j.camilleri
53e6546a53 Syntax editor; add new helper for parsing type signatures (not complete) 2012-11-27 12:00:41 +00:00
john.j.camilleri
7faa501542 Syntax editor: add options for GM in editor_online.js 2012-11-27 11:21:28 +00:00
john.j.camilleri
bd6d7327bf Syntax editor: avoid server calls for each refinement by using cached data 2012-11-27 11:19:12 +00:00
john.j.camilleri
054df2451a Syntax editor: improvements and fixes with grammar manager 2012-11-27 10:09:40 +00:00
hallgren
7d528dc5b3 gfse: add Prelude to the list of RGL modules that can be opened 2012-11-26 15:08:16 +00:00
hallgren
be311aeb07 gfse: more readable layout for not so simple grammars + bug fix
To make definitions that span multiple lines more readable in guided mode,
preserve line breaks and indentation when lin and oper definitions are
displayed and edited in guided mode.

Bug fix: moving the cursor by clicking and selecting text by dragging did
not work in textareas and input fields, because those mouse event were
intercepted by the sort-by-drag-and-drop handler.
2012-11-26 14:11:12 +00:00
hallgren
158aafa3af gf -server + gfse: show modification time of public grammars 2012-11-23 23:21:17 +00:00
hallgren
ba9db76063 gf -server: support overloaded opers in gfse 2012-11-23 19:59:39 +00:00
hallgren
9b3d106ff8 gfse: use POST requests when parsing grammar modules after editing as text
instead of GET, to avoid the Apache httpd URI length limitation.

This means that gfse can no longer use JSONP when parsing grammars, so it
has to be located on the same host as the cloud service.

Also clean away trailing white space in support.js.
2012-11-23 18:51:44 +00:00
hallgren
b410cc75cd Fix a prededence bug in GF grammar pretty printer
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-23 18:44:08 +00:00
john.j.camilleri
dbd5c56049 minibar_online.js: updated to launch Editor using a GrammarManager object 2012-11-23 15:07:51 +00:00
john.j.camilleri
7fe922d5a6 Syntax editor: now uses common GrammarManager object 2012-11-23 15:03:36 +00:00
hallgren
fe9b368b90 syntax editor + minibar: fix bug with repeated switching back and forth
By avoiding "this" in callback functions, the code can be kept cleaner.
2012-11-23 13:15:16 +00:00
john.j.camilleri
3ae7f0df0e Syntax editor: return to editor after having switched to minibar 2012-11-23 08:25:00 +00:00
john.j.camilleri
0dac6fc783 Minibar: call abstract_action with 'this' bound to minibar object 2012-11-23 08:21:00 +00:00