From: Peter Johnson Date: Thu, 11 Oct 2001 19:15:45 +0000 (-0000) Subject: Fix conficts created when adding EQU. X-Git-Tag: v0.1.0~256 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=256511eea8170debe03db2ab74e896fbbbb8b7bb;p=yasm Fix conficts created when adding EQU. svn path=/trunk/yasm/; revision=274 --- diff --git a/modules/parsers/nasm/bison.y.in b/modules/parsers/nasm/bison.y.in index 7848ae8a..91192326 100644 --- a/modules/parsers/nasm/bison.y.in +++ b/modules/parsers/nasm/bison.y.in @@ -108,7 +108,7 @@ static bytecode *nasm_parser_temp_bc; /* @TYPES@ */ -%type line exp instr instrbase +%type line lineexp exp instr instrbase %type fpureg reg32 reg16 reg8 segreg %type 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); } diff --git a/modules/parsers/nasm/nasm-bison.y b/modules/parsers/nasm/nasm-bison.y index 7848ae8a..91192326 100644 --- a/modules/parsers/nasm/nasm-bison.y +++ b/modules/parsers/nasm/nasm-bison.y @@ -108,7 +108,7 @@ static bytecode *nasm_parser_temp_bc; /* @TYPES@ */ -%type line exp instr instrbase +%type line lineexp exp instr instrbase %type fpureg reg32 reg16 reg8 segreg %type 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); } diff --git a/src/parsers/nasm/bison.y.in b/src/parsers/nasm/bison.y.in index 7848ae8a..91192326 100644 --- a/src/parsers/nasm/bison.y.in +++ b/src/parsers/nasm/bison.y.in @@ -108,7 +108,7 @@ static bytecode *nasm_parser_temp_bc; /* @TYPES@ */ -%type line exp instr instrbase +%type line lineexp exp instr instrbase %type fpureg reg32 reg16 reg8 segreg %type 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); } diff --git a/src/parsers/nasm/nasm-bison.y b/src/parsers/nasm/nasm-bison.y index 7848ae8a..91192326 100644 --- a/src/parsers/nasm/nasm-bison.y +++ b/src/parsers/nasm/nasm-bison.y @@ -108,7 +108,7 @@ static bytecode *nasm_parser_temp_bc; /* @TYPES@ */ -%type line exp instr instrbase +%type line lineexp exp instr instrbase %type fpureg reg32 reg16 reg8 segreg %type 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); }