From c0eb4fac3e959324eb3af871353559a09979a814 Mon Sep 17 00:00:00 2001 From: Michael Urman Date: Mon, 9 Jul 2001 05:30:55 +0000 Subject: [PATCH] Better and more generalized kludge for sliding $0.\d down. svn path=/trunk/yasm/; revision=118 --- modules/parsers/nasm/gen_instr.pl | 11 ++++------- src/gen_instr.pl | 11 ++++------- src/parsers/nasm/gen_instr.pl | 11 ++++------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/modules/parsers/nasm/gen_instr.pl b/modules/parsers/nasm/gen_instr.pl index fc94233c..25c8220a 100755 --- a/modules/parsers/nasm/gen_instr.pl +++ b/modules/parsers/nasm/gen_instr.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# $Id: gen_instr.pl,v 1.16 2001/07/06 04:42:59 peter Exp $ +# $Id: gen_instr.pl,v 1.17 2001/07/09 05:30:55 mu Exp $ # Generates bison.y and token.l from instrs.dat for YASM # # Copyright (C) 2001 Michael Urman @@ -154,12 +154,9 @@ sub read_instructions ($) { my ($inst, $args, $groups, $instrfile) = splice @_; - # yes, this is a kludge, to slide $0.\d down by one. - # is there a better way? (other than changing instrs.dat :) - $args =~ s/\$0\.1/\$0\.0/g; - $args =~ s/\$0\.2/\$0\.1/g; - $args =~ s/\$0\.3/\$0\.2/g; - $args =~ s/\$0\.4/\$0\.3/g; + # slide $0.\d down by one. + # i still say changing instrs.dat would be better ;) + $args =~ s/\$0\.([1-4])/ '$0.' . ($1-1) /eg; my ($op, $size, $opcode, $eff, $imm, $cpu) = split /\t+/, $args; eval { diff --git a/src/gen_instr.pl b/src/gen_instr.pl index fc94233c..25c8220a 100755 --- a/src/gen_instr.pl +++ b/src/gen_instr.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# $Id: gen_instr.pl,v 1.16 2001/07/06 04:42:59 peter Exp $ +# $Id: gen_instr.pl,v 1.17 2001/07/09 05:30:55 mu Exp $ # Generates bison.y and token.l from instrs.dat for YASM # # Copyright (C) 2001 Michael Urman @@ -154,12 +154,9 @@ sub read_instructions ($) { my ($inst, $args, $groups, $instrfile) = splice @_; - # yes, this is a kludge, to slide $0.\d down by one. - # is there a better way? (other than changing instrs.dat :) - $args =~ s/\$0\.1/\$0\.0/g; - $args =~ s/\$0\.2/\$0\.1/g; - $args =~ s/\$0\.3/\$0\.2/g; - $args =~ s/\$0\.4/\$0\.3/g; + # slide $0.\d down by one. + # i still say changing instrs.dat would be better ;) + $args =~ s/\$0\.([1-4])/ '$0.' . ($1-1) /eg; my ($op, $size, $opcode, $eff, $imm, $cpu) = split /\t+/, $args; eval { diff --git a/src/parsers/nasm/gen_instr.pl b/src/parsers/nasm/gen_instr.pl index fc94233c..25c8220a 100755 --- a/src/parsers/nasm/gen_instr.pl +++ b/src/parsers/nasm/gen_instr.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# $Id: gen_instr.pl,v 1.16 2001/07/06 04:42:59 peter Exp $ +# $Id: gen_instr.pl,v 1.17 2001/07/09 05:30:55 mu Exp $ # Generates bison.y and token.l from instrs.dat for YASM # # Copyright (C) 2001 Michael Urman @@ -154,12 +154,9 @@ sub read_instructions ($) { my ($inst, $args, $groups, $instrfile) = splice @_; - # yes, this is a kludge, to slide $0.\d down by one. - # is there a better way? (other than changing instrs.dat :) - $args =~ s/\$0\.1/\$0\.0/g; - $args =~ s/\$0\.2/\$0\.1/g; - $args =~ s/\$0\.3/\$0\.2/g; - $args =~ s/\$0\.4/\$0\.3/g; + # slide $0.\d down by one. + # i still say changing instrs.dat would be better ;) + $args =~ s/\$0\.([1-4])/ '$0.' . ($1-1) /eg; my ($op, $size, $opcode, $eff, $imm, $cpu) = split /\t+/, $args; eval { -- 2.40.0