mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 11:19:32 -06:00
First working JavaScript translator.
This commit is contained in:
@@ -15,10 +15,10 @@ GFGrammar.prototype.translate = function (input) {
|
||||
var trees = p.parseString(input, this.abstract.startcat);
|
||||
if (trees.length > 0) {
|
||||
outputs[c1] = new Array();
|
||||
for (var c2 in this.concretes) {
|
||||
outputs[c1][c2] = new Array();
|
||||
for (var i in trees) {
|
||||
outputs[c1][c2][i] = this.concretes[c2].linearize(trees[i]);
|
||||
for (var i in trees) {
|
||||
outputs[c1][i] = new Array();
|
||||
for (var c2 in this.concretes) {
|
||||
outputs[c1][i][c2] = this.concretes[c2].linearize(trees[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user