Parse::RecDescent::Topiary::Base - Base class for autotree constructors


Parse-RecDescent-Topiary documentation Contained in the Parse-RecDescent-Topiary distribution.

Index


Code Index:

NAME

Top

Parse::RecDescent::Topiary::Base - Base class for autotree constructors

SYNOPSIS

Top

  package MyTree::Rule1;
  use base 'Parse::RecDescent::Topiary::Base';

DESCRIPTION

Top

This module provides a method new to build hashref objects for autotree classes. See Parse::RecDescent::Topiary for details.

new

Basic hashref style object constructor. Takes a list of value pairs.

BUGS

Top

Please report bugs to http://rt.cpan.org

AUTHOR

Top

    Ivor Williams
    CPAN ID: IVORW

    ivorw@cpan.org




COPYRIGHT

Top

SEE ALSO

Top

Parse::RecDescent, Parse::RecDescent::Topiary.


Parse-RecDescent-Topiary documentation Contained in the Parse-RecDescent-Topiary distribution.

package Parse::RecDescent::Topiary::Base;
use strict;
use warnings;

our $VERSION = 0.03;

sub new {
    my ( $pkg, %proto ) = @_;

    delete $proto{__RULE__};    #This information is already in the class name
    bless \%proto, $pkg;
}

1;

# The preceding line will help the module return a true value