diff --git a/modules/objfmts/win64/tests/win64-dataref.hex b/modules/objfmts/win64/tests/win64-dataref.hex index fa604a6f..3af07864 100644 --- a/modules/objfmts/win64/tests/win64-dataref.hex +++ b/modules/objfmts/win64/tests/win64-dataref.hex @@ -1364,7 +1364,7 @@ f8 00 00 00 -16 +17 00 00 00 @@ -1374,7 +1374,7 @@ f8 00 00 00 -16 +17 00 00 00 @@ -1999,36 +1999,36 @@ a0 03 00 78 +70 +74 +72 00 00 00 00 +40 00 00 00 -00 +02 00 00 00 03 00 +78 +00 00 00 -03 00 -78 -70 -74 -72 00 00 00 00 -40 00 00 00 -02 +03 00 00 00 diff --git a/modules/parsers/nasm/Makefile.inc b/modules/parsers/nasm/Makefile.inc index 4a57f65c..f4fb977f 100644 --- a/modules/parsers/nasm/Makefile.inc +++ b/modules/parsers/nasm/Makefile.inc @@ -2,9 +2,7 @@ libyasm_a_SOURCES += modules/parsers/nasm/nasm-parser.c libyasm_a_SOURCES += modules/parsers/nasm/nasm-parser.h -libyasm_a_SOURCES += modules/parsers/nasm/nasm-defs.h -libyasm_a_SOURCES += modules/parsers/nasm/nasm-bison.y -libyasm_a_SOURCES += nasm-bison.h +libyasm_a_SOURCES += modules/parsers/nasm/nasm-parse.c libyasm_a_SOURCES += nasm-token.c YASM_MODULES += parser_nasm @@ -12,12 +10,8 @@ YASM_MODULES += parser_nasm nasm-token.c: $(srcdir)/modules/parsers/nasm/nasm-token.re re2c$(EXEEXT) $(top_builddir)/re2c$(EXEEXT) -b -o $@ $(srcdir)/modules/parsers/nasm/nasm-token.re -BUILT_SOURCES += nasm-bison.c -BUILT_SOURCES += nasm-bison.h BUILT_SOURCES += nasm-token.c -CLEANFILES += nasm-bison.c -CLEANFILES += nasm-bison.h CLEANFILES += nasm-token.c EXTRA_DIST += modules/parsers/nasm/tests/Makefile.inc diff --git a/modules/parsers/nasm/nasm-bison.y b/modules/parsers/nasm/nasm-bison.y deleted file mode 100644 index 9fc0dcdb..00000000 --- a/modules/parsers/nasm/nasm-bison.y +++ /dev/null @@ -1,694 +0,0 @@ -/* - * NASM-compatible bison parser - * - * Copyright (C) 2001 Peter Johnson, Michael Urman - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -%{ -#include -RCSID("$Id$"); - -#define YASM_LIB_INTERNAL -#define YASM_EXPR_INTERNAL -#include - -#ifdef STDC_HEADERS -# include -#endif - -#include "modules/parsers/nasm/nasm-parser.h" -#include "modules/parsers/nasm/nasm-defs.h" - -static void nasm_parser_directive - (yasm_parser_nasm *parser_nasm, const char *name, - yasm_valparamhead *valparams, - /*@null@*/ yasm_valparamhead *objext_valparams); -static int fix_directive_symrec(/*@null@*/ yasm_expr__item *ei, - /*@null@*/ void *d); -static void define_label(yasm_parser_nasm *parser_nasm, /*@only@*/ char *name, - int local); - -#define nasm_parser_error(s) yasm_error_set(YASM_ERROR_PARSE, "%s", s) -#define YYPARSE_PARAM parser_nasm_arg -#define YYLEX_PARAM parser_nasm_arg -#define parser_nasm ((yasm_parser_nasm *)parser_nasm_arg) -#define nasm_parser_debug (parser_nasm->debug) - -/*@-usedef -nullassign -memtrans -usereleased -compdef -mustfree@*/ -%} - -%pure_parser - -%union { - unsigned int int_info; - char *str_val; - yasm_intnum *intn; - yasm_floatnum *flt; - yasm_symrec *sym; - unsigned long arch_data[4]; - yasm_effaddr *ea; - yasm_expr *exp; - yasm_datavalhead datahead; - yasm_dataval *data; - yasm_bytecode *bc; - yasm_valparamhead dir_valparams; - yasm_valparam *dir_valparam; - struct { - yasm_insn_operands operands; - int num_operands; - } insn_operands; - yasm_insn_operand *insn_operand; - struct { - char *name; - int local; - } label; - struct { - char *contents; - size_t len; - } str; -} - -%token INTNUM -%token FLTNUM -%token DIRECTIVE_NAME FILENAME -%token STRING ONECHARSTR -%token SIZE_OVERRIDE -%token DECLARE_DATA -%token RESERVE_SPACE -%token INCBIN EQU TIMES -%token SEG WRT NOSPLIT STRICT -%token INSN PREFIX REG SEGREG TARGETMOD -%token LEFT_OP RIGHT_OP SIGNDIV SIGNMOD START_SECTION_ID -%token ID LOCAL_ID SPECIAL_ID -%token LINE - -%type line lineexp exp instr - -%type memaddr -%type dvexpr expr direxpr -%type explabel -%type