1%skip whitespace \s+
2
3%token parenthesis_ <
4%token _parenthesis >
5%token empty_string ""|''
6%token number        (\+|\-)?(0|[1-9]\d*)(\.\d+)?
7%token null          null
8%token comma        ,
9%token name         (?:[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\\)*[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*
10
11%token quote_                      "            -> quoted_string
12%token quoted_string:quoted_string [^"]+
13%token quoted_string:_quote        "            -> default
14
15%token apostrophe_                           '            -> apostrophed_string
16%token apostrophed_string:apostrophed_string [^']+
17%token apostrophed_string:_apostrophe        '            -> default
18
19type:
20    simple_type() | compound_type()
21
22#simple_type:
23    <name>
24    | <number>
25    | <null>
26    | <empty_string>
27    | ::quote_:: <quoted_string> ::_quote::
28    | ::apostrophe_:: <apostrophed_string> ::_apostrophe::
29
30#compound_type:
31    <name>
32    ::parenthesis_::
33    type()
34    ( ::comma:: type() )*
35    ::_parenthesis::
36