Language::Nouse

Perl interpreter for the nouse language
Download

Language::Nouse Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Cal Henderson
  • Publisher web site:
  • http://search.cpan.org/~iamcal/

Language::Nouse Tags


Language::Nouse Description

Perl interpreter for the nouse language Language::Nouse is a Perl interpreter for the nouse language.SYNOPSIS use Language::Nouse; # create a new interpreter my $nouse = new Language::Nouse; # load a linenoise formatted program $nouse->load_linenoise( '#00:0#0>e>0:0#0>f>0>0:0#0^f>0:0#0+4>0:0#0#h>0:0#0^f>0:0#00:0#0>f' ); $nouse->load_linenoise( '>0:0#00:0#0?4>0:0#0^1>0:0#0>1>0:0^0' ); # display the loaded program in assembly mode, with 5 ops per line print $nouse->get_assembly( 5 ); # clear the ring/stack $nouse->clear(); # load an assembly formatted program $nouse->load_assembly( 'read 0, write 6, swap 0, test 2, add 1' ); # run a single step of the program $nouse->step(); # display the loaded program in linenoise mode # NOTE: the previous step() call may have chaged the program in the ring! print $nouse->get_linenoise(); # run the program to completion (until the ring is empty) $nouse->run();The Language::Nouse module is an interpreter for the "nouse" language. It allows you to load and save nouse programs in both linenoise and assembly format, single step and run through code.IO is handled via two callbacks. By default these simply "print" the output and "getc" for input, but can be configured to use custom routines.The internals of the execution engine contain a whole bunch of microcode methods with are used to run the interpreter. The more adventurous can use these methods to finely control the engine and inspect the ring and stack. Requirements: · Perl


Language::Nouse Related Software