3.1 Status
At the moment, the editor supports only a small subset of the GF grammar notation. Proper error checking is done for abstract syntax, but not (yet) for concrete syntax.
The grammars created with this editor always consists of one file for the abstract syntax, and one file for each concrete syntax.
3.1.1. Abstract syntax
The supported abstract syntax corresponds to context-free grammars (no dependent types). The definition of an abstract syntax is limited to
- a list of category names,
Cat_1 ; ... ; Cat_n,
- a list of functions of the form
Fun : Cat_1 -> ... ->
Cat_n
- and a start category.
Available editing operations:
- Categories can be added, removed and renamed. When renaming a category, occurences of it in function types will be updated accordingly.
- Functions can be added, removed and edited. Concrete syntaxes are updated to reflect changes.
- Functions can be reordered using drag-and-drop.
Error checks:
- Syntactically incorrect function definitions are refused.
- Semantic problem such as duplicated definitions or references to undefined categories, are highlighted.
3.1.2. Concrete syntax
At the moment, the concrete syntax for a language L is limited to
- opening the Resource Grammar Library modules
Syntax
L and Paradigms
L,
Lexicon
L and Extra
L,
- linearization types for the categories in the abstract syntax,
- linearizations for the functions in the abstract syntax,
- parameter type definitions,
P = C_1 | ... |C_n,
- and operation definitions, op = expr,
op : type = expr,
Available editing operations:
- The LHSs of the linearization types and linearizations are determined by the abstract syntax and do not need to be entered manually. The RHSs can be edited.
- Parameter types can be added, removed and edited.
- Operation definitons can be added, removed and edited.
- Definitions can be reordered (using drag-and-drop)
Also,
- When a new concrete syntax is added to the grammar, a copy of the currently open concrete syntax is created, since copying and modifying is usually easier than creating something new from scratch. (If the abstract syntax is currently open, the new conrete syntax will start out empty.)
- When adding a new concrete syntax, you normally pick one of the supported languages from a list. The language code and the file name is determined automatically. But you can also pick Other from the list and change the language code afterwards to add a concrete syntax for a language that is not in the list.
Error checks:
- The RHSs in the concrete syntax are checked for syntactic correctness by the editor as they are entered.(TODO: the syntax of parameter types is not check at the moment.)
- Duplicated definitions are highlighted. Checks for other semantic errors are delayed until the grammar is compiled.