VM::Dreamer::Validate - Quality In / Quality Out
validate_definition( $machine_definition );
These functions help make sure that what comes in is what is expected.
Validates the machine's definition. Returns 1 if the definition is value. Otherwise it raises an exception.
Takes the machine's greatest digit, operand_width and instruction_width and returns a regex corresponding to a valid line in an input file to your machine.
my $machine = { meta => { greatest => { digit => 9, }, }, width => { operand => 2, instruction => 3, }, }; my $valid_line = build_valid_line_regex($machine); # qr/^[0-9]{2}\t[0-9]{3}$/
my $machine = { meta => { greatest => { digit => 8, }, }, width => { operand => 6, instruction => 8, }, }; my $valid_line = build_valid_line_regex($machine); # qr/^[0-7]{6}\t[0-7]{8}$/
my $machine = { meta => { greatest => { digit => 1, }, }, width => { instruction => 16, }, }; my $valid_input = get_valid_input_regex($machine); # qr/^[0-1]{16}$/
William Stevenson <william at coders dot coop>
This software is Copyright (c) 2013 by William Stevenson.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install VM::Dreamer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VM::Dreamer
CPAN shell
perl -MCPAN -e shell install VM::Dreamer
For more information on module installation, please visit the detailed CPAN module installation guide.