mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
more comments
This commit is contained in:
@@ -9,9 +9,13 @@ mkAPI().then((pgf) => {
|
|||||||
console.log('arity', expr.arity());
|
console.log('arity', expr.arity());
|
||||||
|
|
||||||
pgf.readPGF("Foods.pgf").then((gr) => {
|
pgf.readPGF("Foods.pgf").then((gr) => {
|
||||||
// Print its name
|
// Print the grammar name
|
||||||
console.log(gr.abstractName);
|
console.log(gr.abstractName);
|
||||||
|
|
||||||
|
// Access a language and print the concrete name
|
||||||
console.log(gr.languages["FoodsEng"].name);
|
console.log(gr.languages["FoodsEng"].name);
|
||||||
|
|
||||||
|
// Linearize an expression
|
||||||
console.log(gr.languages["FoodsEng"].linearize(expr));
|
console.log(gr.languages["FoodsEng"].linearize(expr));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user