#!/usr/bin/perl
use strict;
use warnings;
use lib '../Tree-Template-Declare/blib/lib/';
use lib '../Tree-Transform-XSLTish/blib/lib/';
use lib './lib';
use Parser;
use Compiler;

sub Tree::DAG_Node::XPath::Root::xpath_get_root_node { return $_[0] }
sub Tree::DAG_Node::XPath::Root::xpath_get_parent_node { return }

my $src=do {local $/;<DATA>};
print $src,"----\n\n";
#$::RD_TRACE=1;
my $doc=Parser::parse(\$src);
print "\n----\n$src----\n";
print map "$_\n", @{$doc->draw_ascii_tree};
print "\n----\n";
my $comp=Compiler->new();
print $comp->transform($doc);

__DATA__
gino = 5
if 5 + 3 then pino else rino
pino: print gino
