declarationset      :=  declaration+
declaration         :=  ts , (unreportedname/name) ,ts,'::=',ts, element_token, ( seq_added_token / fo_added_token / and_added_token )*, ts_no_newline, '\n'
seq_added_token     :=  (ts_no_newline, element_token)+
fo_added_token      :=  (ts,'|',ts, element_token)+
and_added_token     :=  (ts,'&',ts, element_token)+
element_token       :=  negpos_indicator?, ts, (literal/range/group/name),ts, occurence_indicator?
group               :=  '(',ts, element_token, ( seq_added_token / fo_added_token / or_added_token / and_added_token )*, ts, ')'

negpos_indicator    :=  '+'/'-'
occurence_indicator :=  '+'/'*'/'?'
unreportedname      :=  '<', name, '>'
name                :=  [a-zA-Z_],[a-zA-Z0-9_]*
<ts>                :=  [ \011-\015]*
<ts_no_newline>     :=  [ \011\013-\015]*
literal             :=  ("'",(CHARNOSNGLQUOTE/ESCAPEDCHAR)*,"'")  /  ('"',(CHARNODBLQUOTE/ESCAPEDCHAR)*,'"')


range               :=  '[',CHARBRACE?,CHARDASH?, (CHARRANGE/CHARNOBRACE)*, '-'?,']'
CHARBRACE           :=  ']'
CHARDASH            :=  '-'
CHARRANGE           :=  CHARNOBRACE, '-', CHARNOBRACE
CHARNOBRACE         :=  ESCAPEDCHAR/CHAR
CHAR                :=  -[]]
ESCAPEDCHAR         :=  '\\',( SPECIALESCAPEDCHAR / HEXESCAPEDCHAR )
SPECIALESCAPEDCHAR  :=  [\\abfnrtv]
HEXESCAPEDCHAR      :=  '#x',[0-9a-fA-F]+
CHARNODBLQUOTE      :=  -[\\"]+
CHARNOSNGLQUOTE     :=  -[\\']+

