Lang::Tree::Builder::Args - wrapper for a tree node constructor's argument list.
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.
Lang::Tree::Builder
Lang::Tree::Builder::Args
Lang::Tree::Builder::Class
argname()
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'].
@args
['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
Bill Hails <me@billhails.net>
Lang::Tree::Builder, Lang::Tree::Builder::Class.
To install Lang::Tree::Builder, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lang::Tree::Builder
CPAN shell
perl -MCPAN -e shell install Lang::Tree::Builder
For more information on module installation, please visit the detailed CPAN module installation guide.