view trans2opcode.pl @ 15:6c1384a939a0

add tran2opcode.pl
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Tue, 27 Nov 2018 17:07:52 +0900
parents
children 39ff8f558152
line wrap: on
line source

use strict;
use warnings;

use FindBin;
use lib "$FindBin::Bin/lib";
use OPCODE2Function;

my $input =  shift; #or die 'use input cur_op';
chomp $input;

if ( $input =~ /^\d+$/){
    print OPCODE2Function->codes($input)."\n";
} else {
    my $ref = OPCODE2Function->name2bitecode($input);
    if (ref($ref ) eq "ARRAY"){
        map { print "$_\n";} @$ref;
    } else {
        print "$_\n";
    }
}