From e36af534bf70e719212836c12f133770357cd93b Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 13 Sep 2011 15:19:16 +0000 Subject: [PATCH] gfse: added grammar cloning --- src/editor/simple/TODO | 7 ++++++- src/editor/simple/editor.js | 12 +++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/editor/simple/TODO b/src/editor/simple/TODO index df64d2b1e..11857594e 100644 --- a/src/editor/simple/TODO +++ b/src/editor/simple/TODO @@ -7,7 +7,7 @@ + Apply function alpha conversion in concrete syntax + 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 + Allow definitions to be reordered @@ -24,6 +24,10 @@ - Easy access to compute_concrete from the editor - Instead of starting with an empty grammar, start a new grammar by copying 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 + '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 flag is actually not set until a selection is made from the menu. + diff --git a/src/editor/simple/editor.js b/src/editor/simple/editor.js index 3b1a9a486..64efd4ab1 100644 --- a/src/editor/simple/editor.js +++ b/src/editor/simple/editor.js @@ -37,12 +37,15 @@ function draw_grammar_list() { editor.appendChild(home) var gs=ul([]); function del(i) { return function () { delete_grammar(i); } } + function clone(i) { return function (g,b) { clone_grammar(i); } } for(var i=0;i