Nathan Gary Glenn > Soar-Production-0.03 > Soar::Production::Printer

Download:
Soar-Production-0.03.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.03   Source  

NAME ^

Soar::Production::Printer - Print Soar productions

VERSION ^

version 0.03

SYNOPSIS ^

  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);
  }

DESCRIPTION ^

This module can be used to print production parse trees produced by Soar::Production::parser. Use the function tree_to_text to accomplish this.

Printing is accomplished by traversing the input structure exactly as it is specified by the grammar used by Soar::Production::Parser.

NAME ^

Soar::Production::pRINT - Perl extension for printing Soar productions

EXPORTED FUNCTIONS ^

The following may be exported to the caller's namespace.

tree_to_text

Argument: parse tree structured as those returned by Soar::Production::Parser. Returns a text representation of the production which can be sourced by Soar.

TODO

Pretty printing is not yet possible, which is too bad because it means the output can be pretty disgusting looking.

AUTHOR ^

Nathan Glenn <garfieldnate@gmail.com>

COPYRIGHT AND LICENSE ^

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.

syntax highlighting: