]> granicus.if.org Git - yasm/commitdiff
Add error rule for all instructions.
authorMichael Urman <mu@tortall.net>
Wed, 30 May 2001 21:39:53 +0000 (21:39 -0000)
committerMichael Urman <mu@tortall.net>
Wed, 30 May 2001 21:39:53 +0000 (21:39 -0000)
svn path=/trunk/yasm/; revision=47

modules/parsers/nasm/gen_instr.pl
src/gen_instr.pl
src/parsers/nasm/gen_instr.pl

index 86d4bb2c6147f4c4e798078525257255ab0f8523..9f9af1c803a2ee802b7fb497d9ec071c07b52d32 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# $Id: gen_instr.pl,v 1.6 2001/05/30 07:26:28 mu Exp $
+# $Id: gen_instr.pl,v 1.7 2001/05/30 21:39:53 mu Exp $
 # Generates bison.y and token.l from instrs.dat for YASM
 #
 #    Copyright (C) 2001  Michael Urman
@@ -449,6 +449,13 @@ sub output_yacc ($@)
                    print GRAMMAR action (@$EAX, $count++);
                }
                
+               # print error action
+               # ASSUMES: at least one previous action exists
+               print GRAMMAR "    | \Uins_$instrname\E error {\n";
+               print GRAMMAR "        Error (ERR_EXP_SYNTAX, (char *)NULL);\n";
+               print GRAMMAR "    }\n";
+
+               # terminate the rule
                print GRAMMAR ";\n";
            }
        }
index 86d4bb2c6147f4c4e798078525257255ab0f8523..9f9af1c803a2ee802b7fb497d9ec071c07b52d32 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# $Id: gen_instr.pl,v 1.6 2001/05/30 07:26:28 mu Exp $
+# $Id: gen_instr.pl,v 1.7 2001/05/30 21:39:53 mu Exp $
 # Generates bison.y and token.l from instrs.dat for YASM
 #
 #    Copyright (C) 2001  Michael Urman
@@ -449,6 +449,13 @@ sub output_yacc ($@)
                    print GRAMMAR action (@$EAX, $count++);
                }
                
+               # print error action
+               # ASSUMES: at least one previous action exists
+               print GRAMMAR "    | \Uins_$instrname\E error {\n";
+               print GRAMMAR "        Error (ERR_EXP_SYNTAX, (char *)NULL);\n";
+               print GRAMMAR "    }\n";
+
+               # terminate the rule
                print GRAMMAR ";\n";
            }
        }
index 86d4bb2c6147f4c4e798078525257255ab0f8523..9f9af1c803a2ee802b7fb497d9ec071c07b52d32 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# $Id: gen_instr.pl,v 1.6 2001/05/30 07:26:28 mu Exp $
+# $Id: gen_instr.pl,v 1.7 2001/05/30 21:39:53 mu Exp $
 # Generates bison.y and token.l from instrs.dat for YASM
 #
 #    Copyright (C) 2001  Michael Urman
@@ -449,6 +449,13 @@ sub output_yacc ($@)
                    print GRAMMAR action (@$EAX, $count++);
                }
                
+               # print error action
+               # ASSUMES: at least one previous action exists
+               print GRAMMAR "    | \Uins_$instrname\E error {\n";
+               print GRAMMAR "        Error (ERR_EXP_SYNTAX, (char *)NULL);\n";
+               print GRAMMAR "    }\n";
+
+               # terminate the rule
                print GRAMMAR ";\n";
            }
        }