<indentfold><beginfold id='1'>(*</beginfold id='1'> This is a foldable multi-line comment
   check regions overlapping priority: Abc -12 \n \x1F \u1a2B 'quoted' \"text\"
   check no parts of speech are detected: ::= | / \ - ! # $ \% & @ ^ ~ * + ? , . ; ( ) [ ] { } < > ` `
   special labels: BUG DEPRECATED FIXME NOTE TEST TODO WARNING
<endfold id='1'>*)</endfold id='1'>
%import common.WS                                    // % extension
<beginfold id='2'>`</beginfold id='2'>namespace('hl_test')<endfold id='2'>`</endfold id='2'>                               // global special sequence
A :≡  'foo' <beginfold id='1'>(*</beginfold id='1'> inline comment <endfold id='1'>*)</endfold id='1'> "bar"               %% strings, comment, string
A :== | '' | "" | B <beginfold id='3'>(</beginfold id='3'>'baz' | "qux"<endfold id='3'>)</endfold id='3'> C                ; grouping, alternation, first 3 alternatives are empty strings
A :=  B1 C1 | B2 C2 / B3 C3 \ B4 C4 - B5 C5 , B6 C6  %% combinators (binary operators), relative piority, permutation
AB = A-B A - B A- B                                  %% '-' as rule name character or combinator
A ::= B ! C # D $ E & F @ G ^ H ~ I * K + L ? M      %% unary operators (prefix, postfix)
A ::  #B B* <beginfold id='4'><</beginfold id='4'>,<endfold id='4'>></endfold id='4'>C C<beginfold id='5'>{</beginfold id='5'>,<endfold id='5'>}</endfold id='5'> <beginfold id='4'><</beginfold id='4'>2<endfold id='4'>></endfold id='4'>D D<beginfold id='5'>{</beginfold id='5'>2<endfold id='5'>}</endfold id='5'> <beginfold id='4'><</beginfold id='4'>2,2<endfold id='4'>></endfold id='4'>E E<beginfold id='5'>{</beginfold id='5'>2,2<endfold id='5'>}</endfold id='5'> <beginfold id='4'><</beginfold id='4'>,2<endfold id='4'>></endfold id='4'>F F<beginfold id='5'>{</beginfold id='5'>,2<endfold id='5'>}</endfold id='5'> <beginfold id='4'><</beginfold id='4'>2,<endfold id='4'>></endfold id='4'>G G<beginfold id='5'>{</beginfold id='5'>2,<endfold id='5'>}</endfold id='5'> <beginfold id='4'><</beginfold id='4'>2,3<endfold id='4'>></endfold id='4'>H H<beginfold id='5'>{</beginfold id='5'>2,3<endfold id='5'>}</endfold id='5'>  %% repetitions (prefix, postfix)
A :  'b' 'c' | 'b' '' 'c' | 'b' ''? 'c' | 'b' <beginfold id='4'><</beginfold id='4'>0<endfold id='4'>></endfold id='4'>B 'c' | 'b' B<beginfold id='5'>{</beginfold id='5'>0<endfold id='5'>}</endfold id='5'> 'c' | 'bc'         %% all alternatives are the same
A =   B C  | <beginfold id='3'>(</beginfold id='3'>  B C  <endfold id='3'>)</endfold id='3'>   |        | <beginfold id='3'>(</beginfold id='3'>B<endfold id='3'>)</endfold id='3'> <beginfold id='3'>(</beginfold id='3'>C<endfold id='3'>)</endfold id='3'>  | <beginfold id='4'><</beginfold id='4'>1  <endfold id='4'>></endfold id='4'><beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'> | <beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'><beginfold id='5'>{</beginfold id='5'>1  <endfold id='5'>}</endfold id='5'> | <beginfold id='4'><</beginfold id='4'>1,1<endfold id='4'>></endfold id='4'><beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'> | <beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'><beginfold id='5'>{</beginfold id='5'>1,1<endfold id='5'>}</endfold id='5'>  %% all alternatives are the same
A <- <beginfold id='6'>[</beginfold id='6'>B C<endfold id='6'>]</endfold id='6'> | (/ B C /)   |        | <beginfold id='3'>(</beginfold id='3'>B   C<endfold id='3'>)</endfold id='3'>? | <beginfold id='4'><</beginfold id='4'> ,1<endfold id='4'>></endfold id='4'><beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'> | <beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'><beginfold id='5'>{</beginfold id='5'> ,1<endfold id='5'>}</endfold id='5'> | <beginfold id='4'><</beginfold id='4'>0,1<endfold id='4'>></endfold id='4'><beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'> | <beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'><beginfold id='5'>{</beginfold id='5'>0,1<endfold id='5'>}</endfold id='5'>  %% all alternatives are the same
A -> <beginfold id='4'><</beginfold id='4'>B C<endfold id='4'>></endfold id='4'> | <beginfold id='5'>{</beginfold id='5'>  B C  <endfold id='5'>}</endfold id='5'> - |        | <beginfold id='3'>(</beginfold id='3'>B   C<endfold id='3'>)</endfold id='3'>+ | <beginfold id='4'><</beginfold id='4'>1, <endfold id='4'>></endfold id='4'><beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'> | <beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'><beginfold id='5'>{</beginfold id='5'>1, <endfold id='5'>}</endfold id='5'>                            %% all alternatives are the same
A <= <beginfold id='5'>{</beginfold id='5'>B C<endfold id='5'>}</endfold id='5'> | (: B C :)   | #<beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'> | <beginfold id='3'>(</beginfold id='3'>B   C<endfold id='3'>)</endfold id='3'>* | <beginfold id='4'><</beginfold id='4'> , <endfold id='4'>></endfold id='4'><beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'> | <beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'><beginfold id='5'>{</beginfold id='5'> , <endfold id='5'>}</endfold id='5'> | <beginfold id='4'><</beginfold id='4'>0, <endfold id='4'>></endfold id='4'><beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'> | <beginfold id='3'>(</beginfold id='3'>B C<endfold id='3'>)</endfold id='3'><beginfold id='5'>{</beginfold id='5'>0, <endfold id='5'>}</endfold id='5'>  %% all alternatives are the same
A => B   C | D .  %% rule terminator
A ←  B   C | D ;  %% rule terminator
A →  B , C | D ;  %% is the same as above in ISO EBNF
A ⇐  '\' \" \\ \a \b \c \t \n \v \f \r \x123 \x9ab \xaBC \xAbc \xABC'
     '\u12345 \u12abc \uAbCdE \uBCDEF \U123456789 \U123abcdef \UabcdBCDEF \U12ABCDEFG 123 abc ABC'  %% escaping
A ⇒  "\' \" \\ \a \b \c \t \n \v \f \r \x123 \x9ab \xaBC \xAbc \xABC"
     "\u12345 \u12abc \uAbCdE \uBCDEF \U123456789 \U123abcdef \UabcdBCDEF \U12ABCDEFG 123 abc ABC"  %% escaping
A = \w \d         %% character class shortcut
Aa1_1aA_                              %% long name in LHS,
  ≜ BC def Gh12 iJ3_4 KlM n_oP _Q_r_  %%   long names in RHS,
  | 'quux'                            %%   multi-line definition,
  | nsX.A-b_alt_lbl: E                %%   alternative's label
  <beginfold id='2'>`</beginfold id='2'>42\`-1\`delete<endfold id='2'>`</endfold id='2'>                    %%   local special sequence with escaped chars
ns1.ns0.A = nso.B C 'corge'           %% names from namespace in LHS and RHS
<beginfold id='4'><</beginfold id='4'>Ab1-2.cd<endfold id='4'>></endfold id='4'> = <beginfold id='4'><</beginfold id='4'>E<endfold id='4'>></endfold id='4'> <beginfold id='4'><</beginfold id='4'>Fg<endfold id='4'>></endfold id='4'> <beginfold id='4'><</beginfold id='4'>_3<endfold id='4'>></endfold id='4'> <beginfold id='4'><</beginfold id='4'>H.i4_J5<endfold id='4'>></endfold id='4'>  %% names quoted by angle brackets
