Lang::Tree::Builder::Parser - Parse Tree Definitions
use Lang::Tree::Builder::Parser; my $parser = new Lang::Tree::Builder::Parser(); my $data = $parser->parseFile($datafile);
A parser for class definitions. The data file input to the parse method has the following simple format:
parse
# a comment [abstract] [<parent>] <class>(<class> [<name>], ... ) ...
for example
# this class has no base class and is initialized with a scalar IntNode(scalar) # the list class is abstract abstract List() # this class is a type of List and takes initializers Foo::Node and Foo::List List Foo::List(Foo::Node first, Foo::List rest) # this class is an abstract type of List and takes no initializers List EmptyList()
apart from arbitrary class names as initializers, the keyword scalar is recognized.
scalar
my $parser = new Lang::Tree::Builder::Parser;
Creates and returns a new instance of a parser.
my $data = $parser->parseFile($datafile);
Parses $datafile and returns an instance of Lang::Tree::Builder::Data
$datafile
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.