]> granicus.if.org Git - yasm/commitdiff
Fix conficts created when adding EQU.
authorPeter Johnson <peter@tortall.net>
Thu, 11 Oct 2001 19:15:45 +0000 (19:15 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 11 Oct 2001 19:15:45 +0000 (19:15 -0000)
svn path=/trunk/yasm/; revision=274

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 7848ae8a5594af58900e82367558ecf0169d268f..91192326884a059764ab1da0f22e2c3b29d9529f 100644 (file)
@@ -108,7 +108,7 @@ static bytecode *nasm_parser_temp_bc;
 
 /* @TYPES@ */
 
-%type <bc> line exp instr instrbase
+%type <bc> line lineexp exp instr instrbase
 
 %type <int_info> fpureg reg32 reg16 reg8 segreg
 %type <ea> mem memaddr memexp memfar
@@ -144,13 +144,7 @@ input: /* empty */
 ;
 
 line: '\n'             { $$ = (bytecode *)NULL; }
-    | exp '\n'
-    | label            { $$ = (bytecode *)NULL; }
-    | label exp                { $$ = $2; }
-    | label_id EQU expr        {
-       symrec_define_equ($1, $3);
-       $$ = (bytecode *)NULL;
-    }
+    | lineexp '\n'
     | directive '\n'   { $$ = (bytecode *)NULL; }
     | error '\n'       {
        Error(_("label or instruction expected at start of line"));
@@ -159,6 +153,15 @@ line: '\n'         { $$ = (bytecode *)NULL; }
     }
 ;
 
+lineexp: exp
+    | label            { $$ = (bytecode *)NULL; }
+    | label exp                { $$ = $2; }
+    | label_id EQU expr        {
+       symrec_define_equ($1, $3);
+       $$ = (bytecode *)NULL;
+    }
+;
+
 exp: instr
     | DECLARE_DATA datavals { $$ = bytecode_new_data(&$2, $1); }
     | RESERVE_SPACE expr    { $$ = bytecode_new_reserve($2, $1); }
index 7848ae8a5594af58900e82367558ecf0169d268f..91192326884a059764ab1da0f22e2c3b29d9529f 100644 (file)
@@ -108,7 +108,7 @@ static bytecode *nasm_parser_temp_bc;
 
 /* @TYPES@ */
 
-%type <bc> line exp instr instrbase
+%type <bc> line lineexp exp instr instrbase
 
 %type <int_info> fpureg reg32 reg16 reg8 segreg
 %type <ea> mem memaddr memexp memfar
@@ -144,13 +144,7 @@ input: /* empty */
 ;
 
 line: '\n'             { $$ = (bytecode *)NULL; }
-    | exp '\n'
-    | label            { $$ = (bytecode *)NULL; }
-    | label exp                { $$ = $2; }
-    | label_id EQU expr        {
-       symrec_define_equ($1, $3);
-       $$ = (bytecode *)NULL;
-    }
+    | lineexp '\n'
     | directive '\n'   { $$ = (bytecode *)NULL; }
     | error '\n'       {
        Error(_("label or instruction expected at start of line"));
@@ -159,6 +153,15 @@ line: '\n'         { $$ = (bytecode *)NULL; }
     }
 ;
 
+lineexp: exp
+    | label            { $$ = (bytecode *)NULL; }
+    | label exp                { $$ = $2; }
+    | label_id EQU expr        {
+       symrec_define_equ($1, $3);
+       $$ = (bytecode *)NULL;
+    }
+;
+
 exp: instr
     | DECLARE_DATA datavals { $$ = bytecode_new_data(&$2, $1); }
     | RESERVE_SPACE expr    { $$ = bytecode_new_reserve($2, $1); }
index 7848ae8a5594af58900e82367558ecf0169d268f..91192326884a059764ab1da0f22e2c3b29d9529f 100644 (file)
@@ -108,7 +108,7 @@ static bytecode *nasm_parser_temp_bc;
 
 /* @TYPES@ */
 
-%type <bc> line exp instr instrbase
+%type <bc> line lineexp exp instr instrbase
 
 %type <int_info> fpureg reg32 reg16 reg8 segreg
 %type <ea> mem memaddr memexp memfar
@@ -144,13 +144,7 @@ input: /* empty */
 ;
 
 line: '\n'             { $$ = (bytecode *)NULL; }
-    | exp '\n'
-    | label            { $$ = (bytecode *)NULL; }
-    | label exp                { $$ = $2; }
-    | label_id EQU expr        {
-       symrec_define_equ($1, $3);
-       $$ = (bytecode *)NULL;
-    }
+    | lineexp '\n'
     | directive '\n'   { $$ = (bytecode *)NULL; }
     | error '\n'       {
        Error(_("label or instruction expected at start of line"));
@@ -159,6 +153,15 @@ line: '\n'         { $$ = (bytecode *)NULL; }
     }
 ;
 
+lineexp: exp
+    | label            { $$ = (bytecode *)NULL; }
+    | label exp                { $$ = $2; }
+    | label_id EQU expr        {
+       symrec_define_equ($1, $3);
+       $$ = (bytecode *)NULL;
+    }
+;
+
 exp: instr
     | DECLARE_DATA datavals { $$ = bytecode_new_data(&$2, $1); }
     | RESERVE_SPACE expr    { $$ = bytecode_new_reserve($2, $1); }
index 7848ae8a5594af58900e82367558ecf0169d268f..91192326884a059764ab1da0f22e2c3b29d9529f 100644 (file)
@@ -108,7 +108,7 @@ static bytecode *nasm_parser_temp_bc;
 
 /* @TYPES@ */
 
-%type <bc> line exp instr instrbase
+%type <bc> line lineexp exp instr instrbase
 
 %type <int_info> fpureg reg32 reg16 reg8 segreg
 %type <ea> mem memaddr memexp memfar
@@ -144,13 +144,7 @@ input: /* empty */
 ;
 
 line: '\n'             { $$ = (bytecode *)NULL; }
-    | exp '\n'
-    | label            { $$ = (bytecode *)NULL; }
-    | label exp                { $$ = $2; }
-    | label_id EQU expr        {
-       symrec_define_equ($1, $3);
-       $$ = (bytecode *)NULL;
-    }
+    | lineexp '\n'
     | directive '\n'   { $$ = (bytecode *)NULL; }
     | error '\n'       {
        Error(_("label or instruction expected at start of line"));
@@ -159,6 +153,15 @@ line: '\n'         { $$ = (bytecode *)NULL; }
     }
 ;
 
+lineexp: exp
+    | label            { $$ = (bytecode *)NULL; }
+    | label exp                { $$ = $2; }
+    | label_id EQU expr        {
+       symrec_define_equ($1, $3);
+       $$ = (bytecode *)NULL;
+    }
+;
+
 exp: instr
     | DECLARE_DATA datavals { $$ = bytecode_new_data(&$2, $1); }
     | RESERVE_SPACE expr    { $$ = bytecode_new_reserve($2, $1); }