gfse: identify inherited grammars by their unique id

This helps avoiding problems if an inherited grammar is renamed, or if there
is more than one grammar with the same name.
This commit is contained in:
hallgren
2012-10-16 22:10:49 +00:00
parent 21e61f4516
commit d63d350cef
3 changed files with 81 additions and 34 deletions

View File

@@ -1,14 +1,16 @@
/* Abstract syntax for a small subset of GF grammars in JavaScript */
/*
type Id = String -- all sorts of identifiers
type UniqueId = String --persistent unique grammar identifier used by the editor
type Id = String -- all sorts of identifiers in grammars
type ModId = Id -- module name
type Cat = Id -- category name
type FunId = Id -- function name
type Type = [Cat] -- [Cat_1,...,Cat_n] means Cat_1 -> ... -> Cat_n
type Grammar = { basename: ModId,
extends: [ModId],
extends: [ModId], -- in 1-to-1 correspondence with uextends
uextends: [UniqueId], -- added 2012-10-16
abstract: Abstract,
concretes: [Concrete] }