Parrot Parrot Compiler Toolkit #50

Adding a new operator to the parser

Now exponentiation with --target=parse:

$ ./parrot calc.pbc --target=parse
> say 3**2;
"parse" => PMC 'Calc::Grammar' => "say 3**2;\n" @ 0
  <statement> => ResizablePMCArray (size:1)
    PMC 'Calc::Grammar' => "say 3**2;\n" @ 0
      <expression> => ResizablePMCArray (size:1)
        PMC 'Calc::Grammar' => "3**2" @ 4
          <expr> => PMC 'PGE::Match' => "**" @ 5
            <top> => Hash
              "name" => "infix:**",
            [0] => PMC 'Calc::Grammar' => "3" @ 4
              <value> => PMC 'Calc::Grammar' => "3" @ 4
                <integer> => PMC 'Calc::Grammar' => "3" @ 4
            [1] => PMC 'Calc::Grammar' => "2" @ 7
              <value> => PMC 'Calc::Grammar' => "2" @ 7
                <integer> => PMC 'Calc::Grammar' => "2" @ 7
Copyright © 2008 Patrick R. Michaud
http://www.pmichaud.com/2008/pres/