data = { SOI ~ block+ }
block = { (line | ignore_line)+ ~ (EOI | NEWLINE*) }
line = { "\\" ~ (anno_field | proc_field) ~ entries? ~ comment? ~ (NEWLINE | EOI) }
ignore_line = { !("\\") ~ (!(NEWLINE | EOI) ~ ANY)+ ~ (NEWLINE | EOI) }
entries = { (spaces ~ (null | entry)?)+ }
anno_field = { ALPHABETIC+ }
proc_field = { "_" ~ ALPHABETIC+ }
entry = { !("###") ~ (parenthetic+ | redub | with_dashes | complex | default) }
complex = { ((pro_clitic ~ spaces)+ ~ default ~ (spaces ~ en_clitic)*) | ((pro_clitic ~ spaces)* ~ default ~ (spaces ~ en_clitic)+)}
default = { valid_chars+ }
parenthetic = { "-"? ~ par_chars* ~ "(" ~ par_chars+ ~ ")" ~ par_chars* }
redub = { ("-" | (!("/") ~ valid_chars)+) ~ ("/" ~ ("-" | (!("/") ~ valid_chars)+))+ }
with_dashes = { valid_chars+ ~ ("-" ~ (valid_chars+ | &(EOI | NEWLINE)) )+ }
pro_clitic = { valid_chars+ ~ "-" ~ !(NEWLINE | EOI) }
en_clitic = { "-" ~ valid_chars+ }
valid_chars = _{ !(" " | NEWLINE | EOI | "-") ~ ANY }
par_chars = _{ !(" " | NEWLINE | EOI | "-" | "(" | ")" ) ~ ANY }
null = { "-" ~ &(spaces | NEWLINE | EOI) }
spaces = { " "+ }
comment = { "###" ~ (!(NEWLINE ~ "\\") ~ ANY)* }