Goo::Thing::pm::Compiler - Compile a Perl program


Goo documentation Contained in the Goo distribution.

Index


Code Index:

NAME

Top

Goo::Thing::pm::Compiler - Compile a Perl program

SYNOPSIS

Top

use Goo::Thing::pm::Compiler;

DESCRIPTION

Top

METHODS

Top

run

Delegate compiling a Perl program to either a Goo::Thing::pm::Perl6Compiler or Goo::Thing::pm::Perl5Compiler.

AUTHOR

Top

Nigel Hamilton <nigel@trexy.com>

SEE ALSO

Top


Goo documentation Contained in the Goo distribution.

##!/usr/bin/perl

package Goo::Thing::pm::Compiler;

###############################################################################
# Nigel Hamilton
#
# Copyright Nigel Hamilton 2005
# All Rights Reserved
#
# Author:       Nigel Hamilton
# Filename:     Compiler.pm
# Description:  Compile a Perl program
#
# Date          Change
# ----------------------------------------------------------------------------
# 01/08/05      Factored out of ProgramEditor as part of the new Goo
# 30/08/2005    Added method: processError
#
##############################################################################

use strict;

use Goo::Object;

use Goo::Thing::pm::TypeChecker;
use Goo::Thing::pm::Perl5Compiler;
use Goo::Thing::pm::Perl6Compiler;

use base qw(Goo::Object);


###############################################################################
#
# run - keep adding a thing to the program
#
###############################################################################

sub run {

    my ($this, $thing) = @_;

    if (Goo::Thing::pm::TypeChecker::is_perl6($thing)) {
        Goo::Thing::pm::Perl6Compiler->new()->run($thing);
    } else {
        Goo::Thing::pm::Perl5Compiler->new()->run($thing);

    }

}

1;


__END__