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

<autotree> only specifies actions for those rules which don't already have actions.

Replies are listed 'Best First'.
Re^4: Parse::RecDescent and auto{actions,trees} and stuff
by mattford63 (Sexton) on Jul 16, 2008 at 17:07 UTC
    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...
      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....