 ----------------------------------------------------------------------
 EBNF for GTRALE-GRISU interface
 2003/02/28 v2.14
 ----------------------------------------------------------------------
 
datapackage-> newdata windowtitle struct_or_rel+ [tree] reentr*"\n"

newdata-> "!newdata" | "!newdata(structure)" | "!newdata(tree)" 

struct_or_rel-> struct | relation

struct-> struc | ref | function | list | set | any | disjunction | conjunction
 
tree-> "(T" flag* id label arclabel? linkid tree* ")"
reentr-> "(R" id " " integer struct ")" 
struc-> "(S" flag* id type featval* ")"
any-> "(A" flag* id value ")"
featval-> "(V" flag* id feature struct ")"
disjunction-> "(O" flag* id struct_or_rel struct_or_rel+ ")"
conjunction-> "(C" flag* id struct_or_rel struct_or_rel+ ")"
list-> "(L" flag* id [struct+ [tail]] ")"
tail-> "(Z" flag* id struct ")"
set-> "(M" flag* id [struct+ [rest]] ")"
rest-> "(Y" flag* id struct ")"
relation-> "(D" flag* id functor struct* ")"
function-> "(F" flag* id type functor struct* ")"
ref-> "(#" flag* id " " integer ")" 
type-> "(" flag* id string ")"
 
flag-> hidden | different | struckout | multiline | expanded
hidden-> "+"
different-> "*"
struckout-> "-"
multiline-> "|"
expanded	-> ">"

feature-> string
functor-> string
windowtitle-> string
label-> string
arclabel-> string
id-> integer
linkid-> integer
value-> string
 

/* Regexp format - how are double quotes dealt with? */
/* The length of strings may not exceed 255 characters. */
string-> "[^"]*"
