# Do not edit this file - Generated by Perlito6 9.0
use v5;
use utf8;
use strict;
use warnings;
no warnings ('redefine', 'once', 'void', 'uninitialized', 'misc', 'recursion');
use Perlito6::Perl5::Runtime;
use Perlito6::Perl5::Prelude;
our $MATCH = Perlito6::Match->new();
{
package GLOBAL;
    sub new { shift; bless { @_ }, "GLOBAL" }

    # use v6 
;
    {
    package CompUnit;
        sub new { shift; bless { @_ }, "CompUnit" }
        sub attributes { $_[0]->{attributes} };
        sub methods { $_[0]->{methods} };
        sub emit {
            my $self = $_[0];
            (chr(35) . ' class ' . $self->{name} . (chr(59) . ' ') . (chr(10)) . Main::join(([ map { $_->emit() } @{( (defined $self->{body} ? $self->{body} : ($self->{body} ||= bless([], 'ARRAY'))) )} ]), (chr(59) . ' ')) . (chr(10)))
        }
    }

;
    {
    package Val::Int;
        sub new { shift; bless { @_ }, "Val::Int" }
        sub emit {
            my $self = $_[0];
            $self->{int}
        }
    }

;
    {
    package Val::Bit;
        sub new { shift; bless { @_ }, "Val::Bit" }
        sub emit {
            my $self = $_[0];
            $self->{bit}
        }
    }

;
    {
    package Val::Num;
        sub new { shift; bless { @_ }, "Val::Num" }
        sub emit {
            my $self = $_[0];
            $self->{num}
        }
    }

;
    {
    package Val::Buf;
        sub new { shift; bless { @_ }, "Val::Buf" }
        sub emit {
            my $self = $_[0];
            (chr(39) . $self->{buf} . chr(39))
        }
    }

;
    {
    package Lit::Array;
        sub new { shift; bless { @_ }, "Lit::Array" }
        sub emit {
            my $self = $_[0];
            ('[' . Main::join(([ map { $_->emit() } @{( (defined $self->{array1} ? $self->{array1} : ($self->{array1} ||= bless([], 'ARRAY'))) )} ]), ', ') . ']')
        }
    }

;
    {
    package Lit::Hash;
        sub new { shift; bless { @_ }, "Lit::Hash" }
        sub emit {
            my $self = $_[0];
            ((my  $fields) = (defined $self->{hash1} ? $self->{hash1} : ($self->{hash1} ||= bless([], 'ARRAY'))));
            ((my  $str) = '');
            for my $field ( @{($fields)} ) {
                ($str = ($str . ($field->[0])->emit() . ' ' . chr(61) . '> ' . ($field->[1])->emit() . ','))
            };
            (chr(123) . ' ' . $str . ' ' . chr(125))
        }
    }

;
    {
    package Index;
        sub new { shift; bless { @_ }, "Index" }
        sub emit {
            my $self = $_[0];
            ($self->{obj}->emit() . '.[' . $self->{index_exp}->emit() . ']')
        }
    }

;
    {
    package Lookup;
        sub new { shift; bless { @_ }, "Lookup" }
        sub emit {
            my $self = $_[0];
            ($self->{obj}->emit() . '.' . chr(123) . $self->{index_exp}->emit() . chr(125))
        }
    }

;
    {
    package Var;
        sub new { shift; bless { @_ }, "Var" }
        sub emit {
            my $self = $_[0];
            ((my  $table) = do {
    (my  $Hash_a = bless {}, 'HASH');
    ($Hash_a->{chr(36)} = chr(36));
    ($Hash_a->{chr(64)} = chr(36) . 'List_');
    ($Hash_a->{chr(37)} = chr(36) . 'Hash_');
    ($Hash_a->{chr(38)} = chr(36) . 'Code_');
    $Hash_a
});
            ((($self->{twigil} eq '.')) ? ((chr(36) . 'self.' . chr(123) . $self->{name} . chr(125))) : (((($self->{name} eq chr(47))) ? (($table->{$self->{sigil}} . 'MATCH')) : (($table->{$self->{sigil}} . $self->{name})))))
        }
    }

;
    {
    package Bind;
        sub new { shift; bless { @_ }, "Bind" }
        sub parameters { $_[0]->{parameters} };
        sub arguments { $_[0]->{arguments} };
        sub emit {
            my $self = $_[0];
            ($self->{parameters}->emit() . ' ' . chr(61) . ' ' . $self->{arguments}->emit())
        }
    }

;
    {
    package Proto;
        sub new { shift; bless { @_ }, "Proto" }
        sub emit {
            my $self = $_[0];
            "".($self->{name})
        }
    }

;
    {
    package Call;
        sub new { shift; bless { @_ }, "Call" }
        sub emit {
            my $self = $_[0];
            ((my  $invocant) = $self->{invocant}->emit());
            if (($invocant eq 'self')) {
                ($invocant = chr(36) . 'self')
            };
            if (((((((($self->{method} eq 'perl')) || (($self->{method} eq 'yaml'))) || (($self->{method} eq 'say'))) || (($self->{method} eq 'join'))) || (($self->{method} eq 'chars'))) || (($self->{method} eq 'isa')))) {
                if (($self->{hyper})) {
                    return scalar (('[ map ' . chr(123) . ' ' . chr(38) . 'Main::' . $self->{method} . '( ' . chr(36) . '_, ' . ', ' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ', ') . ')' . ' ' . chr(125) . ' ' . chr(64) . '( ' . $invocant . ' ) ]'))
                }
                else {
                    return scalar ((chr(38) . 'Main::' . $self->{method} . '(' . $invocant . ', ' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ', ') . ')'))
                }
            };
            ((my  $meth) = $self->{method});
            if (($meth eq 'postcircumfix:<( )>')) {
                ($meth = '')
            };
            ((my  $call) = ('.' . $meth . '(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ', ') . ')'));
            if (($self->{hyper})) {
                ('[ map ' . chr(123) . ' ' . chr(36) . '_' . $call . ' ' . chr(125) . ' ' . chr(64) . '( ' . $invocant . ' ) ]')
            }
            else {
                ($invocant . $call)
            }
        }
    }

;
    {
    package Apply;
        sub new { shift; bless { @_ }, "Apply" }
        sub emit {
            my $self = $_[0];
            ((my  $code) = $self->{code});
            if (Main::isa($code, 'Str')) {

            }
            else {
                return scalar (('(' . $self->{code}->emit() . ').(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ', ') . ')'))
            };
            if (($code eq 'self')) {
                return scalar (chr(36) . 'self')
            };
            if (($code eq 'say')) {
                return scalar (('say(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ', ') . ')'))
            };
            if (($code eq 'print')) {
                return scalar (('print(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ', ') . ')'))
            };
            if (($code eq 'array')) {
                return scalar ((chr(64) . '(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' ') . ')'))
            };
            if (($code eq 'prefix:<' . chr(126) . '>')) {
                return scalar (('(' . chr(34) . chr(34) . ' . ' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' ') . ')'))
            };
            if (($code eq 'prefix:<' . chr(33) . '>')) {
                return scalar (('(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' ') . ' ' . chr(63) . chr(63) . ' 0 ' . chr(33) . chr(33) . ' 1)'))
            };
            if (($code eq 'prefix:<' . chr(63) . '>')) {
                return scalar (('(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' ') . ' ' . chr(63) . chr(63) . ' 1 ' . chr(33) . chr(33) . ' 0)'))
            };
            if (($code eq 'prefix:<' . chr(36) . '>')) {
                return scalar ((chr(36) . '(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' ') . ')'))
            };
            if (($code eq 'prefix:<' . chr(64) . '>')) {
                return scalar ((chr(64) . '(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' ') . ')'))
            };
            if (($code eq 'prefix:<' . chr(37) . '>')) {
                return scalar ((chr(37) . '(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' ') . ')'))
            };
            if (($code eq 'infix:<' . chr(126) . '>')) {
                return scalar (('(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' ' . chr(126) . ' ') . ')'))
            };
            if (($code eq 'infix:<+>')) {
                return scalar (('(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' + ') . ')'))
            };
            if (($code eq 'infix:<->')) {
                return scalar (('(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' - ') . ')'))
            };
            if (($code eq 'infix:<' . chr(38) . chr(38) . '>')) {
                return scalar (('(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' ' . chr(38) . chr(38) . ' ') . ')'))
            };
            if (($code eq 'infix:<' . chr(124) . chr(124) . '>')) {
                return scalar (('(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' ' . chr(124) . chr(124) . ' ') . ')'))
            };
            if (($code eq 'infix:<eq>')) {
                return scalar (('(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' eq ') . ')'))
            };
            if (($code eq 'infix:<ne>')) {
                return scalar (('(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' ne ') . ')'))
            };
            if (($code eq 'infix:<' . chr(61) . chr(61) . '>')) {
                return scalar (('(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' ' . chr(61) . chr(61) . ' ') . ')'))
            };
            if (($code eq 'infix:<' . chr(33) . chr(61) . '>')) {
                return scalar (('(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ' ' . chr(33) . chr(61) . ' ') . ')'))
            };
            if (($code eq 'ternary:<' . chr(63) . chr(63) . ' ' . chr(33) . chr(33) . '>')) {
                return scalar (('(' . ((defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY')))->[0])->emit() . ' ' . chr(63) . chr(63) . ' ' . ((defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY')))->[1])->emit() . ' ' . chr(33) . chr(33) . ' ' . ((defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY')))->[2])->emit() . ')'))
            };
            ('' . $self->{code} . '(' . Main::join(([ map { $_->emit() } @{( (defined $self->{arguments} ? $self->{arguments} : ($self->{arguments} ||= bless([], 'ARRAY'))) )} ]), ', ') . ')')
        }
    }

;
    {
    package Return;
        sub new { shift; bless { @_ }, "Return" }
        sub emit {
            my $self = $_[0];
            return scalar (('return(' . $self->{result}->emit() . ')'))
        }
    }

;
    {
    package If;
        sub new { shift; bless { @_ }, "If" }
        sub emit {
            my $self = $_[0];
            ('do ' . chr(123) . ' if (' . $self->{cond}->emit() . ') ' . chr(123) . ' ' . Main::join(([ map { $_->emit() } @{( (defined $self->{body} ? $self->{body} : ($self->{body} ||= bless([], 'ARRAY'))) )} ]), chr(59)) . ' ' . chr(125) . ' else ' . chr(123) . ' ' . Main::join(([ map { $_->emit() } @{( (defined $self->{otherwise} ? $self->{otherwise} : ($self->{otherwise} ||= bless([], 'ARRAY'))) )} ]), chr(59)) . ' ' . chr(125) . ' ' . chr(125))
        }
    }

;
    {
    package For;
        sub new { shift; bless { @_ }, "For" }
        sub emit {
            my $self = $_[0];
            ((my  $cond) = $self->{cond});
            if ((Main::isa($cond, 'Var') && ($cond->sigil() eq chr(64)))) {
                ($cond = Apply->new(('code' => 'prefix:<' . chr(64) . '>'), ('arguments' => do {
    (my  $List_a = bless [], 'ARRAY');
    (my  $List_v = bless [], 'ARRAY');
    push( @{$List_a}, $cond );
    $List_a
})))
            };
            ('do ' . chr(123) . ' for my ' . $self->{topic}->emit() . ' ( ' . $cond->emit() . ' ) ' . chr(123) . ' ' . Main::join(([ map { $_->emit() } @{( (defined $self->{body} ? $self->{body} : ($self->{body} ||= bless([], 'ARRAY'))) )} ]), chr(59)) . ' ' . chr(125) . ' ' . chr(125))
        }
    }

;
    {
    package Decl;
        sub new { shift; bless { @_ }, "Decl" }
        sub emit {
            my $self = $_[0];
            return scalar (($self->{decl} . ' ' . $self->{type} . ' ' . $self->{var}->emit()))
        }
    }

;
    {
    package Method;
        sub new { shift; bless { @_ }, "Method" }
        sub emit {
            my $self = $_[0];
            ((my  $sig) = $self->{sig});
            ((my  $invocant) = $sig->invocant());
            ((my  $pos) = $sig->positional());
            ((my  $str) = '');
            ((my  $pos) = $sig->positional());
            for my $field ( @{($pos)} ) {
                ($str = ($str . '' . $field->emit() . chr(63) . ', '))
            };
            ('method ' . $self->{name} . '(' . $invocant->emit() . ': ' . $str . ') ' . chr(123) . ' ' . Main::join(([ map { $_->emit() } @{( (defined $self->{block} ? $self->{block} : ($self->{block} ||= bless([], 'ARRAY'))) )} ]), chr(59) . ' ') . ' ' . chr(125))
        }
    }

;
    {
    package Sub;
        sub new { shift; bless { @_ }, "Sub" }
        sub emit {
            my $self = $_[0];
            ((my  $sig) = $self->{sig});
            ((my  $pos) = $sig->positional());
            (my  $str);
            ((my  $pos) = $sig->positional());
            for my $field ( @{($pos)} ) {
                ($str = ($str . '' . $field->emit() . chr(63) . ', '))
            };
            if (($self->{name} eq '')) {
                return scalar (('(sub (' . $str . ') ' . ' ' . chr(123) . ' ' . Main::join(([ map { $_->emit() } @{( (defined $self->{block} ? $self->{block} : ($self->{block} ||= bless([], 'ARRAY'))) )} ]), chr(59) . ' ') . ' ' . chr(125) . ')'))
            };
            ('sub ' . $self->{name} . '(' . $str . ') ' . ' ' . chr(123) . ' ' . Main::join(([ map { $_->emit() } @{( (defined $self->{block} ? $self->{block} : ($self->{block} ||= bless([], 'ARRAY'))) )} ]), chr(59) . ' ') . ' ' . chr(125))
        }
    }

;
    {
    package Do;
        sub new { shift; bless { @_ }, "Do" }
        sub emit {
            my $self = $_[0];
            ('do ' . chr(123) . ' ' . Main::join(([ map { $_->emit() } @{( (defined $self->{block} ? $self->{block} : ($self->{block} ||= bless([], 'ARRAY'))) )} ]), chr(59) . ' ') . ' ' . chr(125))
        }
    }

;
    {
    package Use;
        sub new { shift; bless { @_ }, "Use" }
        sub emit {
            my $self = $_[0];
            ('use ' . $self->{mod})
        }
    }


}

1;
