comparison 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
comparison
equal deleted inserted replaced
14:2e4c952bcdfb 15:6c1384a939a0
1 use strict;
2 use warnings;
3
4 use FindBin;
5 use lib "$FindBin::Bin/lib";
6 use OPCODE2Function;
7
8 my $input = shift; #or die 'use input cur_op';
9 chomp $input;
10
11 if ( $input =~ /^\d+$/){
12 print OPCODE2Function->codes($input)."\n";
13 } else {
14 my $ref = OPCODE2Function->name2bitecode($input);
15 if (ref($ref ) eq "ARRAY"){
16 map { print "$_\n";} @$ref;
17 } else {
18 print "$_\n";
19 }
20 }