NAME
Plasp::Compiler - Role for Plasp providing code compilation
SYNOPSIS
package Plasp;
with 'Plasp::Parser', 'Plasp::Compiler';
sub execute {
my ($self, $scriptref) = @_;
my $parsed = $self->parse($scriptref);
my $subid = $self->compile($parsed->{data});
eval { &$subid };
}
DESCRIPTION
This class implements the ability to compile parsed ASP code.
METHODS
- $self->compile($scriptref, $subid)
-
Takes a
$scriptref
that has been parsed and$subid
for the name of the subroutine to compile the code into. Returns - $self->compile_include($include)
-
Takes an
$include
file. This will search for the file inIncludesDir
and parse it, and assign it a$subid
based on it's filename. - $self->compile_file($file)
-
Takes an
$file
assuming it exists. This will search for the file inIncludesDir
and parse it, and assign it a$subid
based on it's filename. - $self->register_include($scriptref)
-
Registers the file file of any calls to
$Response->Include()
so as to prevent infinite recursion