The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Lang::Tree::Builder::Args - wrapper for a tree node constructor's argument list.

SYNOPSIS

  use Lang::Tree::Builder::Args;
  my $ra_args = Lang::Tree::Builder::Args->List([ [$classname, $argname ] ... ]);

Used internally by Lang::Tree::Builder to encapsulate argument lists, a Lang::Tree::Builder::Args object is a Decorator of the underlying Lang::Tree::Builder::Class. It forwards all method requests to that class and adds an addidional argname() method returning the name of the argument.

List

  my $list = Lang::Tree::Builder::Args->List(\@args);

@args is an array of array refs. Each array ref contains a string typename, and optionally a string varname, for example ['Expr', 'left'].

Returns a listref of Lang::Tree::Builder::Args objects.

If the argument name is omitted from the sub array component describing the argument, then the last part of the class namne will be used in its place.

Argument names will be sequentially numbered to avoid conflicts, but only if necessary. For example given the following call

  my $ra_args = Lang::Tree::Builder::Args->List([
    [qw(Foo::Expr)],
    [qw(Foo::Expr)],
    [qw(Foo::Expr foo)],
    [qw(Foo::Expr foo)],
    [qw(Foo::Expr bar)],
    [qw(Foo::ExprList)]
  ])

The resulting argument names will be:

  Expr1, Expr2, foo1, foo2, bar, ExprList

AUTHOR

  Bill Hails <me@billhails.net>

SEE ALSO

Lang::Tree::Builder, Lang::Tree::Builder::Class.