Руслан У. Закиров > MarpaX-Repa > MarpaX::Repa::Actions

Download:
MarpaX-Repa-0.10.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

MarpaX::Repa::Actions - set of actions to begin with

DESCRIPTION ^

Some actions to start with that just present rules as various perl structures. Just to help you concentrate on grammar at the beginning.

METHODS ^

import

Marpa at the moment doesn't use inheritance to lookup actions, so instead of subclassing this module exports all actions and new method, but only if '-base' is passed:

    package MyActions;
    use MarpaX::Repa::Actions '-base';

new

Just returns a new hash based instance of the class. See 'action_object' in Marpa::R2::Grammar.

do_what_I_mean

Returns:

    { rule => 'rule name', value => $child || \@children }

do_join_children

Returns:

    { rule => 'rule name', value => join '', @children }

do_join

Returns:

    join '', @children

do_list

Returns:

    \@children

do_scalar_or_list

Returns:

    $child || \@children

do_flat_to_list

Returns (pseudo code):

    [ map @$_||%$_||$_, grep defined, @_ ]

do_ignore

Returns:

    undef
syntax highlighting: