in reply to Re^3: Parse::RecDescent and auto{actions,trees} and stuff
in thread Parse::RecDescent and auto{actions,trees} and stuff

I get the fact it only works for rules without actions (but I could be missing something here). But I don't get why it breaks my code and stops the recursion as it shouldn't affect the custom case...
  • Comment on Re^4: Parse::RecDescent and auto{actions,trees} and stuff

Replies are listed 'Best First'.
Re^5: Parse::RecDescent and auto{actions,trees} and stuff
by ikegami (Patriarch) on Jul 16, 2008 at 20:14 UTC
    Because you assumes cpu_num returns a number ($arg[0]-1), but it returns a blessed object when <autotree> is used.

      I see. So I tried to fix (so it will run, not necessarily do want I want) by doing this.

      cpu_num: int { $item[1] }

      i.e., fixing the return value so that the recursion works assuming as an action is specified <autotree> won't overwrite it.

      However it still fails...

      UPDATE: I just reliased I needed to do the same of int: for it too leap into life. :-)

      I guess I need to somehow manually bless the lines with actions defined in order to flush out my parse tree....

        I find it very valuable to seperate tokens from non-token rules. And I find very little worth in <auto...>
        cpus : INT cpu_list[ $item[1] ] { [ $item[0], $item[2] ] } INT : /\d+/ # Add "{ $item[1] }" if using "<auto...>"