# This lines are automatically generated by tool/opcode_for_pp.PL.
# ANY CHANGES WILL BE LOST!
package Text::Xslate::PP::Const;
use strict;

use parent qw(Exporter);

{
    no strict 'refs';
    our @EXPORT    = ( grep { defined &{$_} } sort keys %Text::Xslate::PP::Const:: );
    our @EXPORT_OK = (@EXPORT, qw(%OPS @OPCODE @OPARGS));
    our %EXPORT_TAGS = (
        all       => \@EXPORT_OK,
    );
}

use constant TXARGf_SV      => 0x01;
use constant TXARGf_INT     => 0x02;
use constant TXARGf_KEY     => 0x04;
use constant TXARGf_VAR     => 0x08;
use constant TXARGf_PC      => 0x10;

# note that these flags are different form XS's because
# of the difference of data structure
use constant TXCODE_W_SV    => TXARGf_SV;
use constant TXCODE_W_SVIV  => (TXARGf_SV | TXARGf_INT) ;
use constant TXCODE_W_KEY   => (TXARGf_SV | TXARGf_KEY);
use constant TXCODE_W_INT   => (TXARGf_SV | TXARGf_INT);
use constant TXCODE_W_VAR   => (TXARGf_SV | TXARGf_INT | TXARGf_VAR);
use constant TXCODE_GOTO    => (TXARGf_SV | TXARGf_INT | TXARGf_PC);

# template representation, stored in $self->{template}{$file}
use constant TXo_MTIME          => 0;
use constant TXo_CACHEPATH      => 1;
use constant TXo_FULLPATH       => 2;

# vm execution frame
use constant TXframe_NAME       => 0;
use constant TXframe_OUTPUT     => 1;
use constant TXframe_RETADDR    => 2;
use constant TXframe_START_LVAR => 3;

use constant TX_VERBOSE_DEFAULT => 1;

# for-loop variables
use constant TXfor_ITEM  => 0;
use constant TXfor_ITER  => 1;
use constant TXfor_ARRAY => 2;

# types
use constant TXt_RAW   => 'Text::Xslate::Type::Raw';
use constant TXt_MACRO => 'Text::Xslate::PP::Type::Macro';
use constant TXt_PAIR  => 'Text::Xslate::PP::Type::Pair';

our %OPS = (
    noop             => 0,
    move_to_sb       => 1,
    move_from_sb     => 2,
    save_to_lvar     => 3,
    load_lvar        => 4,
    load_lvar_to_sb  => 5,
    localize_s       => 6,
    push             => 7,
    pushmark         => 8,
    nil              => 9,
    literal          => 10,
    literal_i        => 11,
    fetch_s          => 12,
    fetch_field      => 13,
    fetch_field_s    => 14,
    print            => 15,
    print_raw        => 16,
    print_raw_s      => 17,
    include          => 18,
    for_start        => 19,
    for_iter         => 20,
    add              => 21,
    sub              => 22,
    mul              => 23,
    div              => 24,
    mod              => 25,
    concat           => 26,
    repeat           => 27,
    bitor            => 28,
    bitand           => 29,
    bitxor           => 30,
    bitneg           => 31,
    and              => 32,
    dand             => 33,
    or               => 34,
    dor              => 35,
    not              => 36,
    minus            => 37,
    max_index        => 38,
    builtin_mark_raw => 39,
    builtin_unmark_raw => 40,
    builtin_uri      => 41,
    builtin_is_array_ref => 42,
    builtin_is_hash_ref => 43,
    builtin_html_escape => 44,
    match            => 45,
    eq               => 46,
    ne               => 47,
    lt               => 48,
    le               => 49,
    gt               => 50,
    ge               => 51,
    ncmp             => 52,
    scmp             => 53,
    range            => 54,
    fetch_symbol     => 55,
    funcall          => 56,
    macro_end        => 57,
    methodcall_s     => 58,
    make_array       => 59,
    make_hash        => 60,
    enter            => 61,
    leave            => 62,
    goto             => 63,
    depend           => 64,
    macro_begin      => 65,
    macro_nargs      => 66,
    macro_outer      => 67,
    set_opinfo       => 68,
    super            => 69,
    end              => 70,
); # %OPS

our @OPCODE = (
    \&Text::Xslate::PP::Opcode::op_noop,                # 0
    \&Text::Xslate::PP::Opcode::op_move_to_sb,          # 1
    \&Text::Xslate::PP::Opcode::op_move_from_sb,        # 2
    \&Text::Xslate::PP::Opcode::op_save_to_lvar,        # 3
    \&Text::Xslate::PP::Opcode::op_load_lvar,           # 4
    \&Text::Xslate::PP::Opcode::op_load_lvar_to_sb,     # 5
    \&Text::Xslate::PP::Opcode::op_localize_s,          # 6
    \&Text::Xslate::PP::Opcode::op_push,                # 7
    \&Text::Xslate::PP::Opcode::op_pushmark,            # 8
    \&Text::Xslate::PP::Opcode::op_nil,                 # 9
    \&Text::Xslate::PP::Opcode::op_literal,             # 10
    \&Text::Xslate::PP::Opcode::op_literal_i,           # 11
    \&Text::Xslate::PP::Opcode::op_fetch_s,             # 12
    \&Text::Xslate::PP::Opcode::op_fetch_field,         # 13
    \&Text::Xslate::PP::Opcode::op_fetch_field_s,       # 14
    \&Text::Xslate::PP::Opcode::op_print,               # 15
    \&Text::Xslate::PP::Opcode::op_print_raw,           # 16
    \&Text::Xslate::PP::Opcode::op_print_raw_s,         # 17
    \&Text::Xslate::PP::Opcode::op_include,             # 18
    \&Text::Xslate::PP::Opcode::op_for_start,           # 19
    \&Text::Xslate::PP::Opcode::op_for_iter,            # 20
    \&Text::Xslate::PP::Opcode::op_add,                 # 21
    \&Text::Xslate::PP::Opcode::op_sub,                 # 22
    \&Text::Xslate::PP::Opcode::op_mul,                 # 23
    \&Text::Xslate::PP::Opcode::op_div,                 # 24
    \&Text::Xslate::PP::Opcode::op_mod,                 # 25
    \&Text::Xslate::PP::Opcode::op_concat,              # 26
    \&Text::Xslate::PP::Opcode::op_repeat,              # 27
    \&Text::Xslate::PP::Opcode::op_bitor,               # 28
    \&Text::Xslate::PP::Opcode::op_bitand,              # 29
    \&Text::Xslate::PP::Opcode::op_bitxor,              # 30
    \&Text::Xslate::PP::Opcode::op_bitneg,              # 31
    \&Text::Xslate::PP::Opcode::op_and,                 # 32
    \&Text::Xslate::PP::Opcode::op_dand,                # 33
    \&Text::Xslate::PP::Opcode::op_or,                  # 34
    \&Text::Xslate::PP::Opcode::op_dor,                 # 35
    \&Text::Xslate::PP::Opcode::op_not,                 # 36
    \&Text::Xslate::PP::Opcode::op_minus,               # 37
    \&Text::Xslate::PP::Opcode::op_max_index,           # 38
    \&Text::Xslate::PP::Opcode::op_builtin_mark_raw,    # 39
    \&Text::Xslate::PP::Opcode::op_builtin_unmark_raw,  # 40
    \&Text::Xslate::PP::Opcode::op_builtin_uri,         # 41
    \&Text::Xslate::PP::Opcode::op_builtin_is_array_ref, # 42
    \&Text::Xslate::PP::Opcode::op_builtin_is_hash_ref, # 43
    \&Text::Xslate::PP::Opcode::op_builtin_html_escape, # 44
    \&Text::Xslate::PP::Opcode::op_match,               # 45
    \&Text::Xslate::PP::Opcode::op_eq,                  # 46
    \&Text::Xslate::PP::Opcode::op_ne,                  # 47
    \&Text::Xslate::PP::Opcode::op_lt,                  # 48
    \&Text::Xslate::PP::Opcode::op_le,                  # 49
    \&Text::Xslate::PP::Opcode::op_gt,                  # 50
    \&Text::Xslate::PP::Opcode::op_ge,                  # 51
    \&Text::Xslate::PP::Opcode::op_ncmp,                # 52
    \&Text::Xslate::PP::Opcode::op_scmp,                # 53
    \&Text::Xslate::PP::Opcode::op_range,               # 54
    \&Text::Xslate::PP::Opcode::op_fetch_symbol,        # 55
    \&Text::Xslate::PP::Opcode::op_funcall,             # 56
    \&Text::Xslate::PP::Opcode::op_macro_end,           # 57
    \&Text::Xslate::PP::Opcode::op_methodcall_s,        # 58
    \&Text::Xslate::PP::Opcode::op_make_array,          # 59
    \&Text::Xslate::PP::Opcode::op_make_hash,           # 60
    \&Text::Xslate::PP::Opcode::op_enter,               # 61
    \&Text::Xslate::PP::Opcode::op_leave,               # 62
    \&Text::Xslate::PP::Opcode::op_goto,                # 63
    \&Text::Xslate::PP::Opcode::op_depend,              # 64
    \&Text::Xslate::PP::Opcode::op_macro_begin,         # 65
    \&Text::Xslate::PP::Opcode::op_macro_nargs,         # 66
    \&Text::Xslate::PP::Opcode::op_macro_outer,         # 67
    \&Text::Xslate::PP::Opcode::op_set_opinfo,          # 68
    \&Text::Xslate::PP::Opcode::op_super,               # 69
    \&Text::Xslate::PP::Opcode::op_end,                 # 70
); # @OPCODE

our @OPARGS = (
    0,             # noop
    0,             # move_to_sb
    0,             # move_from_sb
    TXCODE_W_VAR,  # save_to_lvar
    TXCODE_W_VAR,  # load_lvar
    TXCODE_W_VAR,  # load_lvar_to_sb
    TXCODE_W_KEY,  # localize_s
    0,             # push
    0,             # pushmark
    0,             # nil
    TXCODE_W_SV,   # literal
    TXCODE_W_SVIV, # literal_i
    TXCODE_W_KEY,  # fetch_s
    0,             # fetch_field
    TXCODE_W_KEY,  # fetch_field_s
    0,             # print
    0,             # print_raw
    TXCODE_W_SV,   # print_raw_s
    0,             # include
    TXCODE_W_VAR,  # for_start
    TXCODE_GOTO,   # for_iter
    0,             # add
    0,             # sub
    0,             # mul
    0,             # div
    0,             # mod
    TXCODE_W_SV,   # concat
    TXCODE_W_SV,   # repeat
    0,             # bitor
    0,             # bitand
    0,             # bitxor
    0,             # bitneg
    TXCODE_GOTO,   # and
    TXCODE_GOTO,   # dand
    TXCODE_GOTO,   # or
    TXCODE_GOTO,   # dor
    0,             # not
    0,             # minus
    0,             # max_index
    0,             # builtin_mark_raw
    0,             # builtin_unmark_raw
    0,             # builtin_uri
    0,             # builtin_is_array_ref
    0,             # builtin_is_hash_ref
    0,             # builtin_html_escape
    0,             # match
    0,             # eq
    0,             # ne
    0,             # lt
    0,             # le
    0,             # gt
    0,             # ge
    0,             # ncmp
    0,             # scmp
    0,             # range
    TXCODE_W_KEY,  # fetch_symbol
    0,             # funcall
    0,             # macro_end
    TXCODE_W_KEY,  # methodcall_s
    0,             # make_array
    0,             # make_hash
    0,             # enter
    0,             # leave
    TXCODE_GOTO,   # goto
    TXCODE_W_SV,   # depend
    TXCODE_W_KEY,  # macro_begin
    TXCODE_W_SVIV, # macro_nargs
    TXCODE_W_SVIV, # macro_outer
    0,             # set_opinfo
    0,             # super
    0,             # end
); # @OPARGS

1;
__END__

=pod

=head1 NAME

Text::Xslate::PP::Const - Text::Xslate constants in pure Perl

=head1 DESCRIPTION

This module is used by Text::Xslate::PP internally.

=head1 SEE ALSO

L<Text::Xslate>

L<Text::Xslate::PP>

=head1 LICENSE AND COPYRIGHT

Copyright (c) 2010 by Makamaka Hannyaharamitu (makamaka).

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

