App::Scheme79asm::Compiler - compile Lisp code to SIMPLE assembly
use App::Scheme79asm; use App::Scheme79asm::Compiler; use Data::SExpression qw/cons/; my $asm = App::Scheme79asm->new; my $compiler = App::Scheme79asm::Compiler->new; my $string = '(reverse-list 2 1)'; my $assembly_sexp = $compiler->compile_string($string); $asm->process($assembly_sexp); $asm->finish; $asm->print_verilog
This module takes Lisp code and compiles it to the format that App::Scheme79asm wants it to be.
The two main methods are compile_sexp($sexp) which compiles an already-parsed sexp to assembly format, and compile_string($string) which compiles a string to assembly format.
The assembly format is a sexp. These functions return an already-parsed sexp (an arrayref like the ones returned by Data::SExpression's read method). This arrayref can be passed directly to App::Scheme79asm's process method.
If a string representation of the sexp is required, it can be obtained by calling the dump_sexp function in Data::Dump::Sexp with such an arrayref.
Marius Gavrilescu, <email@example.com>
Copyright (C) 2018 by Marius Gavrilescu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.24.3 or, at your option, any later version of Perl 5 you may have available.