Soar::Production::Printer - Print Soar productions
version 0.03
use Soar::Production::Parser; use Soar::Production::Printer qw(tree_to_text); #read in a series of productions from a file my $parser = Soar::Production::Parser->new; my @trees=$parser->parse_file("foo.soar"); #print each of the productions to standard out for my $prod(@trees){ print tree_to_text($prod); }
This module can be used to print production parse trees produced by Soar::Production::parser. Use the function tree_to_text to accomplish this.
tree_to_text
Printing is accomplished by traversing the input structure exactly as it is specified by the grammar used by Soar::Production::Parser.
Soar::Production::pRINT - Perl extension for printing Soar productions
The following may be exported to the caller's namespace.
Argument: parse tree structured as those returned by Soar::Production::Parser. Returns a text representation of the production which can be sourced by Soar.
Pretty printing is not yet possible, which is too bad because it means the output can be pretty disgusting looking.
Nathan Glenn <garfieldnate@gmail.com>
This software is copyright (c) 2012 by Nathan Glenn.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Soar::Production, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Soar::Production
CPAN shell
perl -MCPAN -e shell install Soar::Production
For more information on module installation, please visit the detailed CPAN module installation guide.