Soar::Production - REPRESENT SOAR PRODUCTIONS
version 0.03
use Soar::Production qw(prods_from prods_from_file); my $prods = prods_from_file( '/path/to/file' ); for my $prod (@$prods){ print $prod->name . "\n"; } my $prod = 'sp{myName (state <s>) --> (<s> ^foo bar) }'; my $prod = Soar::Production->new($prod);
This is a module for storing, manipulating, and querying Soar productions. There isn't much functionality implemented, yet. Currently there are functions for
Soar::Production- Store and manipulate Soar productions
new
Argument: text of a Soar production. Creates a new production object using the input text.
name
Optional argument: name to assign production. Sets the name of the current production if an argument is given. Returns the name of the production.
The following functions may be exported:
prods_from_file
A shortcut for prods_from(file = $arg)>.
prods_from(file =
prods_from
This method extracts productions from a given text. It returns a reference to an array containing production objects. Note that all comments are removed as a preprocessing step to detecting and extracting productions. It takes a set of named arguments: file- the name of a file to read. text- the text to read. You must choose to export this function via the use function:
file
text
use
use Soar::Production qw(prods_from);
state_name
Set/get name of matched state
superstate_name
Set/get name of matched state's superstate
type
Does this production match a state or an impasse?
validate
Check this production against a datamap.
Soar::Production::Parser does not check semantic correctness. The following are good things to check:
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.