1
0
forked from GitHub/gf-core

started a WASM version of the runtime

This commit is contained in:
Krasimir Angelov
2023-09-13 20:24:35 +02:00
parent e17d435284
commit d557f45ebd
4 changed files with 517 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
mkAPI().then((pgf) => {
// Parse expression
console.log(pgf.readExpr("Pred (This Fish) Fresh"));
/*
// Show it
console.log(expr.toString());
// Print its arity
console.log('arity', expr.arity());
pgf.readPGF("Foods.pgf").then((gr) => {
// Print the grammar name
console.log(gr.abstractName);
// Access a language and print the concrete name
console.log(gr.languages["FoodsEng"].name);
// Linearize an expression
console.log(gr.languages["FoodsEng"].linearize(expr));
});*/
});