forked from GitHub/gf-core
started a WASM version of the runtime
This commit is contained in:
21
src/runtime/javascript/test-web.js
Normal file
21
src/runtime/javascript/test-web.js
Normal 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));
|
||||
});*/
|
||||
});
|
||||
Reference in New Issue
Block a user