mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
gfse: added grammar cloning
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
+ Apply function alpha conversion in concrete syntax
|
+ Apply function alpha conversion in concrete syntax
|
||||||
+ Change lhs of lins when function type is changed
|
+ Change lhs of lins when function type is changed
|
||||||
|
|
||||||
- Allow languages other than the ones in the given list to be added
|
+ Allow languages other than the ones in the given list to be added
|
||||||
+ Export as plain text
|
+ Export as plain text
|
||||||
+ Allow definitions to be reordered
|
+ Allow definitions to be reordered
|
||||||
|
|
||||||
@@ -24,6 +24,10 @@
|
|||||||
- Easy access to compute_concrete from the editor
|
- Easy access to compute_concrete from the editor
|
||||||
- Instead of starting with an empty grammar, start a new grammar by copying
|
- Instead of starting with an empty grammar, start a new grammar by copying
|
||||||
an example.
|
an example.
|
||||||
|
+ Cloning grammars
|
||||||
|
- Allow grammars to contain a resoure module. Create the resource module by
|
||||||
|
factoring out common parts of the concrete syntaxes.
|
||||||
|
- Integrate example-based concrete syntax construction (using Ramona's tool)
|
||||||
|
|
||||||
+ compile only the uploaded grammar even if other grammars are present
|
+ compile only the uploaded grammar even if other grammars are present
|
||||||
+ 'flags startcat' is needed for grammars with only one category (since the
|
+ 'flags startcat' is needed for grammars with only one category (since the
|
||||||
@@ -34,3 +38,4 @@
|
|||||||
|
|
||||||
+ Bug! The startcat menu shows the first category by default, but the startcat
|
+ Bug! The startcat menu shows the first category by default, but the startcat
|
||||||
flag is actually not set until a selection is made from the menu.
|
flag is actually not set until a selection is made from the menu.
|
||||||
|
|
||||||
|
|||||||
@@ -37,12 +37,15 @@ function draw_grammar_list() {
|
|||||||
editor.appendChild(home)
|
editor.appendChild(home)
|
||||||
var gs=ul([]);
|
var gs=ul([]);
|
||||||
function del(i) { return function () { delete_grammar(i); } }
|
function del(i) { return function () { delete_grammar(i); } }
|
||||||
|
function clone(i) { return function (g,b) { clone_grammar(i); } }
|
||||||
for(var i=0;i<local.count;i++) {
|
for(var i=0;i<local.count;i++) {
|
||||||
var grammar=local.get(i,null);
|
var grammar=local.get(i,null);
|
||||||
if(grammar && grammar.basename) {
|
if(grammar && grammar.basename) {
|
||||||
var link=a(jsurl("open_grammar("+i+")"),[text(grammar.basename)]);
|
var link=a(jsurl("open_grammar("+i+")"),[text(grammar.basename)]);
|
||||||
gs.appendChild(
|
gs.appendChild(
|
||||||
li([deletable(del(i),link,"Delete this grammar")]))
|
node("li",{"class":"extensible"},
|
||||||
|
[deletable(del(i),link,"Delete this grammar"),
|
||||||
|
more(grammar,clone(i),"Clone this grammar")]))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(local.get("count",null)==null)
|
if(local.get("count",null)==null)
|
||||||
@@ -80,6 +83,13 @@ function delete_grammar(i) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clone_grammar(i) {
|
||||||
|
var old=local.get(i);
|
||||||
|
var g={basename:old.basename,abstract:old.abstract,concretes:old.concretes}
|
||||||
|
save_grammar(g);
|
||||||
|
draw_grammar_list();
|
||||||
|
}
|
||||||
|
|
||||||
function open_grammar(i) {
|
function open_grammar(i) {
|
||||||
var g=local.get(i);
|
var g=local.get(i);
|
||||||
g.index=i;
|
g.index=i;
|
||||||
|
|||||||
Reference in New Issue
Block a user