Lang::Tree::Builder::Data - Tree Data
use Lang::Tree::Builder::Parser; my $parser = new Lang::Tree::Builder::Parser(); my $data = $parser->parseFile($datafile); foreach my $class ($data->classes()) { my $parent = $class->parent(); my @args = $class->args(); my $name = $class->name(); # etc }
This package contains an ever-growing list of accessor methods to make the maintainance and extension of templates easy. See below for the full list.
my $class = new Lang::Tree::Builder::Class(%params);
Creates and returns a new instance of Class. Don't do this, the parser does it for you, however for reference, %params is:
%params
The class name.
The parent class name, if any.
The arguments to the constructor, will be passed to Lang::Tree::Builder::Args::List()
True if the class was declared abstract.
Note that each class is unique, and that additional calls to new may be used to add information to an existing class object which will then be returned. It is an error for new information to conflict with existing information however.
new
Returns the fully qualified class name, with parts joined by :: by default. An alternative join string can be passed as an optional argument.
::
Returns the parent class, or false if no parent.
Returns an array of arguments to the constructor. Each element is a Lang::Tree::Builder::Args.
Lang::Tree::Builder::Args
Returns the number of args the constructor accepts.
Returns an array or arrayref of the components of the class name. For example Foo::Expr has parts Foo and Expr.
Foo::Expr
Foo
Expr
Returns the last component of parts above.
parts
Returns all but the last component of parts, joined with :: by default, but an alternative can be supplied as an optional argument.
Returns an equivalent interface name by prepending a literal i to the last part of the class name.
i
Returns false
Returns true if the class was defined in the config (as opposed to merely being used as an argument type). Not to be confused with is_concrete.
is_concrete
Returns true if the class was declared abstract.
Returns true if the class was not declared abstract. N.b. a class is concrete by default, is_substantial could still return false for the same class.
is_substantial
Lang::Tree::Builder
Bill Hails, <me@billhails.net>
Copyright (C) 2008 by Bill Hails
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
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.