]> granicus.if.org Git - yasm/commitdiff
Fix issues with yy->nasm_parser_ renaming. AM_YFLAGS/AM_LFLAGS are not an
authorPeter Johnson <peter@tortall.net>
Thu, 27 Dec 2001 03:52:10 +0000 (03:52 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 27 Dec 2001 03:52:10 +0000 (03:52 -0000)
option because those are /global/ for the entire project.

svn path=/trunk/yasm/; revision=409

12 files changed:
modules/parsers/nasm/Makefile.inc
modules/parsers/nasm/bison.y.in
modules/parsers/nasm/nasm-bison.y
modules/parsers/nasm/nasm-defs.h [new file with mode: 0644]
modules/parsers/nasm/nasm-parser.c
modules/parsers/nasm/token.l.in
src/parsers/nasm/Makefile.inc
src/parsers/nasm/bison.y.in
src/parsers/nasm/nasm-bison.y
src/parsers/nasm/nasm-defs.h [new file with mode: 0644]
src/parsers/nasm/nasm-parser.c
src/parsers/nasm/token.l.in

index 9b0e6144272a0c6f07ea0f2ba48e23ba6876bf82..dbe7010d0be51ed53f7f67456321381a559cb7ff 100644 (file)
@@ -2,6 +2,7 @@
 
 YASMPARSERFILES += \
        src/parsers/nasm/nasm-parser.c          \
+       src/parsers/nasm/nasm-defs.h            \
        nasm-bison.y                            \
        nasm-bison.h                            \
        nasm-token.l
@@ -38,9 +39,6 @@ endif
 
 noinst_SCRIPTS = src/parsers/nasm/gen_instr.pl
 
-AM_YFLAGS = -d --name-prefix=nasm_parser_
-AM_LFLAGS = -Pnasm_parser_ -olex.yy.c
-
 BUILT_SOURCES += \
        nasm-bison.y                            \
        nasm-bison.c                            \
index 87d4c67a4552bbec1df33f0ce950968e1f1837ba..d16775b9a3e9ceec60f97ccab9494a7c8adadb3a 100644 (file)
@@ -42,6 +42,8 @@ RCSID("$IdPath$");
 
 #include "arch.h"
 
+#include "src/parsers/nasm/nasm-defs.h"
+
 void init_table(void);
 extern int nasm_parser_lex(void);
 void nasm_parser_error(const char *);
index 87d4c67a4552bbec1df33f0ce950968e1f1837ba..d16775b9a3e9ceec60f97ccab9494a7c8adadb3a 100644 (file)
@@ -42,6 +42,8 @@ RCSID("$IdPath$");
 
 #include "arch.h"
 
+#include "src/parsers/nasm/nasm-defs.h"
+
 void init_table(void);
 extern int nasm_parser_lex(void);
 void nasm_parser_error(const char *);
diff --git a/modules/parsers/nasm/nasm-defs.h b/modules/parsers/nasm/nasm-defs.h
new file mode 100644 (file)
index 0000000..cfbc7cd
--- /dev/null
@@ -0,0 +1,80 @@
+/* $IdPath$
+ * Variable name redefinitions for NASM-compatible parser
+ *
+ *  Copyright (C) 2001  Peter Johnson
+ *
+ *  This file is part of YASM.
+ *
+ *  YASM is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  YASM is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#define yy_create_buffer       nasm_parser__create_buffer
+#define yy_delete_buffer       nasm_parser__delete_buffer
+#define yy_init_buffer         nasm_parser__init_buffer
+#define yy_load_buffer_state   nasm_parser__load_buffer_state
+#define yy_switch_to_buffer    nasm_parser__switch_to_buffer
+#define yyact                  nasm_parser_act
+#define yyback                 nasm_parser_back
+#define yybgin                 nasm_parser_bgin
+#define yychar                 nasm_parser_char
+#define yychk                  nasm_parser_chk
+#define yycrank                        nasm_parser_crank
+#define yydebug                        nasm_parser_debug
+#define yydef                  nasm_parser_def
+#define yyerrflag              nasm_parser_errflag
+#define yyerror                        nasm_parser_error
+#define yyestate               nasm_parser_estate
+#define yyexca                 nasm_parser_exca
+#define yyextra                        nasm_parser_extra
+#define yyfnd                  nasm_parser_fnd
+#define yyin                   nasm_parser_in
+#define yyinput                        nasm_parser_input
+#define yyleng                 nasm_parser_leng
+#define yylex                  nasm_parser_lex
+#define yylineno               nasm_parser_lineno
+#define yylook                 nasm_parser_look
+#define yylsp                  nasm_parser_lsp
+#define yylstate               nasm_parser_lstate
+#define yylval                 nasm_parser_lval
+#define yymatch                        nasm_parser_match
+#define yymorfg                        nasm_parser_morfg
+#define yynerrs                        nasm_parser_nerrs
+#define yyolsp                 nasm_parser_olsp
+#define yyout                  nasm_parser_out
+#define yyoutput               nasm_parser_output
+#define yypact                 nasm_parser_pact
+#define yyparse                        nasm_parser_parse
+#define yypgo                  nasm_parser_pgo
+#define yyprevious             nasm_parser_previous
+#define yyps                   nasm_parser_ps
+#define yypv                   nasm_parser_pv
+#define yyr1                   nasm_parser_r1
+#define yyr2                   nasm_parser_r2
+#define yyreds                 nasm_parser_reds
+#define yyrestart              nasm_parser_restart
+#define yys                    nasm_parser_s
+#define yysbuf                 nasm_parser_sbuf
+#define yysptr                 nasm_parser_sptr
+#define yystate                        nasm_parser_state
+#define yysvec                 nasm_parser_svec
+#define yytchar                        nasm_parser_tchar
+#define yytext                 nasm_parser_text
+#define yytmp                  nasm_parser_tmp
+#define yytoks                 nasm_parser_toks
+#define yytop                  nasm_parser_top
+#define yyunput                        nasm_parser_unput
+#define yyv                    nasm_parser_v
+#define yyval                  nasm_parser_val
+#define yyvstop                        nasm_parser_vstop
+/*#define yywrap                       nasm_parser_wrap*/
index 0b896f94a74324db2830a39e87e757549cea8a38..0911ce75c997750f7fd3311ba65648d16e9447b8 100644 (file)
@@ -35,7 +35,7 @@ extern int nasm_parser_debug;
 
 extern int nasm_parser_parse(void);
 
-size_t (*nasm_parser_yyinput) (char *buf, size_t max_size);
+size_t (*nasm_parser_input) (char *buf, size_t max_size);
 
 sectionhead nasm_parser_sections;
 /*@dependent@*/ section *nasm_parser_cur_section;
@@ -48,7 +48,7 @@ nasm_parser_do_parse(parser *p, FILE *f)
 {
     p->current_pp->initialize(f);
     nasm_parser_in = f;
-    nasm_parser_yyinput = p->current_pp->input;
+    nasm_parser_input = p->current_pp->input;
 
     /* Initialize section list */
     nasm_parser_cur_section = sections_initialize(&nasm_parser_sections);
index 70b14b76b78a894d6f6cce11439971776b3f7458..b0b160c4380689c8e7f8a8ed66468fd1f5147c35 100644 (file)
@@ -35,18 +35,17 @@ RCSID("$IdPath$");
 
 #include "arch.h"
 
+#include "src/parsers/nasm/nasm-defs.h"
 #include "nasm-bison.h"
 
 
 #define YY_NEVER_INTERACTIVE   1
 
-#define yylval nasm_parser_lval
-
 int nasm_parser_lex(void);
 
-extern size_t (*nasm_parser_yyinput) (char *buf, size_t max_size);
+extern size_t (*nasm_parser_input) (char *buf, size_t max_size);
 #undef YY_INPUT
-#define YY_INPUT(b, r, ms)     (r = nasm_parser_yyinput(b, ms))
+#define YY_INPUT(b, r, ms)     (r = nasm_parser_input(b, ms))
 
 /* starting size of string buffer */
 #define STRBUF_ALLOC_SIZE      128
@@ -66,6 +65,9 @@ static int linechg_numcount;
 %option noyywrap
 %option nounput
 %option case-insensitive
+%option never-interactive
+%option prefix="nasm_parser_"
+%option outfile="lex.yy.c"
 
 %x DIRECTIVE LINECHG LINECHG2
 %s DIRECTIVE2
index 9b0e6144272a0c6f07ea0f2ba48e23ba6876bf82..dbe7010d0be51ed53f7f67456321381a559cb7ff 100644 (file)
@@ -2,6 +2,7 @@
 
 YASMPARSERFILES += \
        src/parsers/nasm/nasm-parser.c          \
+       src/parsers/nasm/nasm-defs.h            \
        nasm-bison.y                            \
        nasm-bison.h                            \
        nasm-token.l
@@ -38,9 +39,6 @@ endif
 
 noinst_SCRIPTS = src/parsers/nasm/gen_instr.pl
 
-AM_YFLAGS = -d --name-prefix=nasm_parser_
-AM_LFLAGS = -Pnasm_parser_ -olex.yy.c
-
 BUILT_SOURCES += \
        nasm-bison.y                            \
        nasm-bison.c                            \
index 87d4c67a4552bbec1df33f0ce950968e1f1837ba..d16775b9a3e9ceec60f97ccab9494a7c8adadb3a 100644 (file)
@@ -42,6 +42,8 @@ RCSID("$IdPath$");
 
 #include "arch.h"
 
+#include "src/parsers/nasm/nasm-defs.h"
+
 void init_table(void);
 extern int nasm_parser_lex(void);
 void nasm_parser_error(const char *);
index 87d4c67a4552bbec1df33f0ce950968e1f1837ba..d16775b9a3e9ceec60f97ccab9494a7c8adadb3a 100644 (file)
@@ -42,6 +42,8 @@ RCSID("$IdPath$");
 
 #include "arch.h"
 
+#include "src/parsers/nasm/nasm-defs.h"
+
 void init_table(void);
 extern int nasm_parser_lex(void);
 void nasm_parser_error(const char *);
diff --git a/src/parsers/nasm/nasm-defs.h b/src/parsers/nasm/nasm-defs.h
new file mode 100644 (file)
index 0000000..cfbc7cd
--- /dev/null
@@ -0,0 +1,80 @@
+/* $IdPath$
+ * Variable name redefinitions for NASM-compatible parser
+ *
+ *  Copyright (C) 2001  Peter Johnson
+ *
+ *  This file is part of YASM.
+ *
+ *  YASM is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  YASM is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#define yy_create_buffer       nasm_parser__create_buffer
+#define yy_delete_buffer       nasm_parser__delete_buffer
+#define yy_init_buffer         nasm_parser__init_buffer
+#define yy_load_buffer_state   nasm_parser__load_buffer_state
+#define yy_switch_to_buffer    nasm_parser__switch_to_buffer
+#define yyact                  nasm_parser_act
+#define yyback                 nasm_parser_back
+#define yybgin                 nasm_parser_bgin
+#define yychar                 nasm_parser_char
+#define yychk                  nasm_parser_chk
+#define yycrank                        nasm_parser_crank
+#define yydebug                        nasm_parser_debug
+#define yydef                  nasm_parser_def
+#define yyerrflag              nasm_parser_errflag
+#define yyerror                        nasm_parser_error
+#define yyestate               nasm_parser_estate
+#define yyexca                 nasm_parser_exca
+#define yyextra                        nasm_parser_extra
+#define yyfnd                  nasm_parser_fnd
+#define yyin                   nasm_parser_in
+#define yyinput                        nasm_parser_input
+#define yyleng                 nasm_parser_leng
+#define yylex                  nasm_parser_lex
+#define yylineno               nasm_parser_lineno
+#define yylook                 nasm_parser_look
+#define yylsp                  nasm_parser_lsp
+#define yylstate               nasm_parser_lstate
+#define yylval                 nasm_parser_lval
+#define yymatch                        nasm_parser_match
+#define yymorfg                        nasm_parser_morfg
+#define yynerrs                        nasm_parser_nerrs
+#define yyolsp                 nasm_parser_olsp
+#define yyout                  nasm_parser_out
+#define yyoutput               nasm_parser_output
+#define yypact                 nasm_parser_pact
+#define yyparse                        nasm_parser_parse
+#define yypgo                  nasm_parser_pgo
+#define yyprevious             nasm_parser_previous
+#define yyps                   nasm_parser_ps
+#define yypv                   nasm_parser_pv
+#define yyr1                   nasm_parser_r1
+#define yyr2                   nasm_parser_r2
+#define yyreds                 nasm_parser_reds
+#define yyrestart              nasm_parser_restart
+#define yys                    nasm_parser_s
+#define yysbuf                 nasm_parser_sbuf
+#define yysptr                 nasm_parser_sptr
+#define yystate                        nasm_parser_state
+#define yysvec                 nasm_parser_svec
+#define yytchar                        nasm_parser_tchar
+#define yytext                 nasm_parser_text
+#define yytmp                  nasm_parser_tmp
+#define yytoks                 nasm_parser_toks
+#define yytop                  nasm_parser_top
+#define yyunput                        nasm_parser_unput
+#define yyv                    nasm_parser_v
+#define yyval                  nasm_parser_val
+#define yyvstop                        nasm_parser_vstop
+/*#define yywrap                       nasm_parser_wrap*/
index 0b896f94a74324db2830a39e87e757549cea8a38..0911ce75c997750f7fd3311ba65648d16e9447b8 100644 (file)
@@ -35,7 +35,7 @@ extern int nasm_parser_debug;
 
 extern int nasm_parser_parse(void);
 
-size_t (*nasm_parser_yyinput) (char *buf, size_t max_size);
+size_t (*nasm_parser_input) (char *buf, size_t max_size);
 
 sectionhead nasm_parser_sections;
 /*@dependent@*/ section *nasm_parser_cur_section;
@@ -48,7 +48,7 @@ nasm_parser_do_parse(parser *p, FILE *f)
 {
     p->current_pp->initialize(f);
     nasm_parser_in = f;
-    nasm_parser_yyinput = p->current_pp->input;
+    nasm_parser_input = p->current_pp->input;
 
     /* Initialize section list */
     nasm_parser_cur_section = sections_initialize(&nasm_parser_sections);
index 70b14b76b78a894d6f6cce11439971776b3f7458..b0b160c4380689c8e7f8a8ed66468fd1f5147c35 100644 (file)
@@ -35,18 +35,17 @@ RCSID("$IdPath$");
 
 #include "arch.h"
 
+#include "src/parsers/nasm/nasm-defs.h"
 #include "nasm-bison.h"
 
 
 #define YY_NEVER_INTERACTIVE   1
 
-#define yylval nasm_parser_lval
-
 int nasm_parser_lex(void);
 
-extern size_t (*nasm_parser_yyinput) (char *buf, size_t max_size);
+extern size_t (*nasm_parser_input) (char *buf, size_t max_size);
 #undef YY_INPUT
-#define YY_INPUT(b, r, ms)     (r = nasm_parser_yyinput(b, ms))
+#define YY_INPUT(b, r, ms)     (r = nasm_parser_input(b, ms))
 
 /* starting size of string buffer */
 #define STRBUF_ALLOC_SIZE      128
@@ -66,6 +65,9 @@ static int linechg_numcount;
 %option noyywrap
 %option nounput
 %option case-insensitive
+%option never-interactive
+%option prefix="nasm_parser_"
+%option outfile="lex.yy.c"
 
 %x DIRECTIVE LINECHG LINECHG2
 %s DIRECTIVE2