Parse Trees

<autotree>
start:        die  /^\Z/

die:          'd' faces
            | count 'd' faces

count:        number
faces:        number
number:       /\d+/

In [1] := 3d4
Out [1] = $VAR1 = bless( {
          2 => '',
          'die' => bless( {
                  'faces' => bless( {
                          'number' => bless( {
                                   '__VALUE__' => 4
                                 }, 'number' ),
                          '__RULE__' => 'faces'
                        }, 'faces' ),
                  2 => 'd',
                  'count' => bless( {
                          'number' => bless( {
                                   '__VALUE__' => 3
                                 }, 'number' ),
                          '__RULE__' => 'count'
                        }, 'count' ),
                  '__RULE__' => 'die'
                }, 'die' ),
          '__RULE__' => 'start'
        }, 'start' );

[Prev] [Next] [Index]