From 403b315bb1f3b9b61630cf123f348cb19070dd6c Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 2 Oct 2000 08:14:22 +0000 Subject: [PATCH] * src/LR0.h: New file. Propagate its use. --- ChangeLog | 6 ++++++ src/LR0.c | 3 +-- src/LR0.h | 26 ++++++++++++++++++++++++++ src/Makefile.am | 2 +- src/main.c | 13 +------------ 5 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 src/LR0.h diff --git a/ChangeLog b/ChangeLog index 5876dad9..71813192 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-10-02 Akim Demaille + + * src/LR0.h: New file. + Propagate its use. + + 2000-10-02 Akim Demaille * src/print.h: New file. diff --git a/src/LR0.c b/src/LR0.c index 61ac236c..9643ee8d 100644 --- a/src/LR0.c +++ b/src/LR0.c @@ -28,6 +28,7 @@ #include "state.h" #include "complain.h" #include "closure.h" +#include "LR0.h" extern short *itemset; extern short *itemsetend; @@ -38,8 +39,6 @@ core *first_state; shifts *first_shift; reductions *first_reduction; -extern void generate_states PARAMS ((void)); - static core *this_state; static core *last_state; static shifts *last_shift; diff --git a/src/LR0.h b/src/LR0.h new file mode 100644 index 00000000..30109526 --- /dev/null +++ b/src/LR0.h @@ -0,0 +1,26 @@ +/* Generate the nondeterministic finite state machine for bison, + Copyright (C) 1984, 1986, 1989, 2000 Free Software Foundation, Inc. + + This file is part of Bison, the GNU Compiler Compiler. + + Bison 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, or (at your option) + any later version. + + Bison 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 Bison; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef LR0_H_ +# define LR0_H_ + +void generate_states PARAMS ((void)); + +#endif /* !LR0_H_ */ diff --git a/src/Makefile.am b/src/Makefile.am index 4919ddbb..fa7d8fb7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,7 +18,7 @@ bison_SOURCES = LR0.c allocate.c closure.c complain.c conflicts.c \ EXTRA_bison_SOURCES = vmsgetargs.c -noinst_HEADERS = alloc.h closure.h complain.h conflicts.h \ +noinst_HEADERS = LR0.h alloc.h closure.h complain.h conflicts.h \ derives.h \ files.h getargs.h gram.h lalr.h lex.h nullable.h \ output.h state.h \ diff --git a/src/main.c b/src/main.c index 248bcd89..6b07e209 100644 --- a/src/main.c +++ b/src/main.c @@ -31,11 +31,7 @@ #include "reduce.h" #include "nullable.h" #include "print.h" - -#if 0 /* XXX currently unused. */ -/* Nonzero means failure has been detected; don't write a parser file. */ -static int failure; -#endif +#include "LR0.h" /* The name this program was run with, for messages. */ char *program_name; @@ -44,13 +40,6 @@ extern void berror PARAMS((const char *)); extern char *printable_version PARAMS ((int)); -extern void generate_states PARAMS ((void)); -extern void initialize_conflicts PARAMS ((void)); -extern void finalize_conflicts PARAMS ((void)); - - -/* VMS complained about using `int'. */ - int main (int argc, char *argv[]) { -- 2.45.2