]> granicus.if.org Git - yasm/commitdiff
Allow multiple labels on one line (it's still on the TODO list for NASM :).
authorPeter Johnson <peter@tortall.net>
Sun, 19 Aug 2001 05:44:53 +0000 (05:44 -0000)
committerPeter Johnson <peter@tortall.net>
Sun, 19 Aug 2001 05:44:53 +0000 (05:44 -0000)
svn path=/trunk/yasm/; revision=147

modules/parsers/nasm/bison.y.in
modules/parsers/nasm/nasm-bison.y
src/parsers/nasm/bison.y.in
src/parsers/nasm/nasm-bison.y

index 28590b864f6f15e2470a2e4c063e0aad4d006c4b..206d3aaa58f0849f4852bb28caf31de3a29092a0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bison.y.in,v 1.24 2001/08/19 05:41:01 peter Exp $
+/* $Id: bison.y.in,v 1.25 2001/08/19 05:44:53 peter Exp $
  * Main bison parser
  *
  *  Copyright (C) 2001  Peter Johnson, Michael Urman
@@ -117,8 +117,6 @@ input: /* empty */
 
 line: '\n'     { $$.type = BC_EMPTY; }
     | exp '\n' { DebugPrintBC(&$1); $$ = $1; }
-    | label exp '\n' { DebugPrintBC(&$2); $$ = $2; }
-    | label '\n'
     | directive '\n' { $$.type = BC_EMPTY; }
     | error '\n' {
        Error(ERR_INVALID_LINE, (char *)NULL);
@@ -130,6 +128,8 @@ line: '\n'  { $$.type = BC_EMPTY; }
 exp: instr
     | DECLARE_DATA datavals    { BuildBC_Data(&$$, &$2, $1); }
     | RESERVE_SPACE expr       { BuildBC_Reserve(&$$, $2, $1); }
+    | label exp                        { $$ = $2; }
+    | label                    { $$.type = BC_EMPTY; }
 ;
 
 datavals: dataval              {
index 1516e8661d79c9dec88aa9e1c43f5f18eabb9343..93e13fbd18b141012b09c609c6dc955de4909261 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: nasm-bison.y,v 1.24 2001/08/19 05:41:01 peter Exp $
+/* $Id: nasm-bison.y,v 1.25 2001/08/19 05:44:53 peter Exp $
  * Main bison parser
  *
  *  Copyright (C) 2001  Peter Johnson, Michael Urman
@@ -117,8 +117,6 @@ input: /* empty */
 
 line: '\n'     { $$.type = BC_EMPTY; }
     | exp '\n' { DebugPrintBC(&$1); $$ = $1; }
-    | label exp '\n' { DebugPrintBC(&$2); $$ = $2; }
-    | label '\n'
     | directive '\n' { $$.type = BC_EMPTY; }
     | error '\n' {
        Error(ERR_INVALID_LINE, (char *)NULL);
@@ -130,6 +128,8 @@ line: '\n'  { $$.type = BC_EMPTY; }
 exp: instr
     | DECLARE_DATA datavals    { BuildBC_Data(&$$, &$2, $1); }
     | RESERVE_SPACE expr       { BuildBC_Reserve(&$$, $2, $1); }
+    | label exp                        { $$ = $2; }
+    | label                    { $$.type = BC_EMPTY; }
 ;
 
 datavals: dataval              {
index 28590b864f6f15e2470a2e4c063e0aad4d006c4b..206d3aaa58f0849f4852bb28caf31de3a29092a0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bison.y.in,v 1.24 2001/08/19 05:41:01 peter Exp $
+/* $Id: bison.y.in,v 1.25 2001/08/19 05:44:53 peter Exp $
  * Main bison parser
  *
  *  Copyright (C) 2001  Peter Johnson, Michael Urman
@@ -117,8 +117,6 @@ input: /* empty */
 
 line: '\n'     { $$.type = BC_EMPTY; }
     | exp '\n' { DebugPrintBC(&$1); $$ = $1; }
-    | label exp '\n' { DebugPrintBC(&$2); $$ = $2; }
-    | label '\n'
     | directive '\n' { $$.type = BC_EMPTY; }
     | error '\n' {
        Error(ERR_INVALID_LINE, (char *)NULL);
@@ -130,6 +128,8 @@ line: '\n'  { $$.type = BC_EMPTY; }
 exp: instr
     | DECLARE_DATA datavals    { BuildBC_Data(&$$, &$2, $1); }
     | RESERVE_SPACE expr       { BuildBC_Reserve(&$$, $2, $1); }
+    | label exp                        { $$ = $2; }
+    | label                    { $$.type = BC_EMPTY; }
 ;
 
 datavals: dataval              {
index 1516e8661d79c9dec88aa9e1c43f5f18eabb9343..93e13fbd18b141012b09c609c6dc955de4909261 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: nasm-bison.y,v 1.24 2001/08/19 05:41:01 peter Exp $
+/* $Id: nasm-bison.y,v 1.25 2001/08/19 05:44:53 peter Exp $
  * Main bison parser
  *
  *  Copyright (C) 2001  Peter Johnson, Michael Urman
@@ -117,8 +117,6 @@ input: /* empty */
 
 line: '\n'     { $$.type = BC_EMPTY; }
     | exp '\n' { DebugPrintBC(&$1); $$ = $1; }
-    | label exp '\n' { DebugPrintBC(&$2); $$ = $2; }
-    | label '\n'
     | directive '\n' { $$.type = BC_EMPTY; }
     | error '\n' {
        Error(ERR_INVALID_LINE, (char *)NULL);
@@ -130,6 +128,8 @@ line: '\n'  { $$.type = BC_EMPTY; }
 exp: instr
     | DECLARE_DATA datavals    { BuildBC_Data(&$$, &$2, $1); }
     | RESERVE_SPACE expr       { BuildBC_Reserve(&$$, $2, $1); }
+    | label exp                        { $$ = $2; }
+    | label                    { $$.type = BC_EMPTY; }
 ;
 
 datavals: dataval              {