XMG - eXtensible MetaGrammar (1)
10. December 2012
Laura Kallmeyer, Timm Lichte
Setting up the system on your account
The XMG-tools are part of a virtual machine (VM), that needs to be startet with VirtualBox.
- Start the VM xmg&tulipa.
- At some point a login screen appears: user name = xmguser, password = xmguser
- Open a terminal and type:
$ cd xmg
The command to start the XMG-compiler is MetaTAG. Try the following:
$ MetaTAG gimpl-xtag-1.xmg
The layout of XMG source files
Have a look at the XMG source file:
$ less gimpl-xtag-1.xmg
It contains a small metagrammar for the alphanx0V tree template, i.e. a transitive verb in base order.
The XMG source file basically has four sections:
- Declarations
- Descriptions of tree fragments
- Descriptions of tree templates
- Evaluation statements
Declarations
In the first section, types, properties and features are specified.
- "Types" are XMG's data types.
- "Properties" specify the properties of nodes as a whole, e.g. whether they are footnodes or substitution nodes.
- "Features" are TAG-features inside nodes.
Descriptions of tree fragments and tree templates
Descriptions of tree fragments and tree templates consist of class declarations, which contain the following:
- declare: declaration of used variables, e.g. ?NP.
- export: Which of the variables are visible outside?
- Note: Variables can identify nodes or class instantiations.
- Nodes can only be defined inside the <syn>-dimension.
- Classes can only be instantiated outside the <syn>-dimension.
Evaluation
The evaluation the class alphanx0V is invoked by:
valuation alphanx0V
A comprehensive XMG-documentation
http://wiki.loria.fr/wiki/XMG/Documentation
Timm Lichte
Last modified: Sun Dec 9 22:36:42 CET 2012