 TUPLE: ebnf-terminal symbol ;
 TUPLE: ebnf-any-character ;
 TUPLE: ebnf-range pattern ;
+TUPLE: ebnf-ensure group ;
 TUPLE: ebnf-ensure-not group ;
 TUPLE: ebnf-choice options ;
 TUPLE: ebnf-sequence elements ;

    'group' sp ,
  ] seq* [ first <ebnf-ensure-not> ] action ;

: ('sequence') ( -- parser )
  #! A sequence of terminals and non-terminals, including
  #! groupings of those. 
  [ 
    'ensure-not' sp ,
    'element' sp ,
    'group' sp , 
    'repeat0' sp ,


M: ebnf-range (transform) ( ast -- parser )
  ebnf-range-pattern range-pattern ;

M: ebnf-ensure (transform) ( ast -- parser )
  ebnf-ensure-group (transform) ensure ;

M: ebnf-ensure-not (transform) ( ast -- parser )
  ebnf-ensure-not-group (transform) ensure-not ;
