view trans2opcode.pl @ 17:39ff8f558152

fix trans2opcode
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Fri, 30 Nov 2018 15:32:08 +0900
parents 6c1384a939a0
children
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 "$ref\n";
    }
}