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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
/* Compute how to make the finite state machine deterministic;
#include "machine.h"
#include "types.h"
#include "state.h"
-#include "new.h"
+#include "alloc.h"
#include "gram.h"
short *from_state;
short *to_state;
-short **transpose();
-void set_state_table();
-void set_accessing_symbol();
-void set_shift_table();
-void set_reduction_table();
-void set_maxrhs();
-void initialize_LA();
-void set_goto_map();
-void initialize_F();
-void build_relations();
-void add_lookback_edge();
-void compute_FOLLOWS();
-void compute_lookaheads();
-void digraph();
-void traverse();
-
-extern void toomany();
-extern void berror();
+void lalr PARAMS((void));
+short **transpose PARAMS((short **, int));
+void set_state_table PARAMS((void));
+void set_accessing_symbol PARAMS((void));
+void set_shift_table PARAMS((void));
+void set_reduction_table PARAMS((void));
+void set_maxrhs PARAMS((void));
+void initialize_LA PARAMS((void));
+void set_goto_map PARAMS((void));
+int map_goto PARAMS((int, int));
+void initialize_F PARAMS((void));
+void build_relations PARAMS((void));
+void add_lookback_edge PARAMS((int, int, int));
+void compute_FOLLOWS PARAMS((void));
+void compute_lookaheads PARAMS((void));
+void digraph PARAMS((short **));
+void traverse PARAMS((register int));
+
+extern void toomany PARAMS((char *));
+extern void berror PARAMS((char *));
static int infinity;
static int maxrhs;
void
-lalr()
+lalr (void)
{
tokensetsize = WORDSIZE(ntokens);
void
-set_state_table()
+set_state_table (void)
{
register core *sp;
void
-set_accessing_symbol()
+set_accessing_symbol (void)
{
register core *sp;
void
-set_shift_table()
+set_shift_table (void)
{
register shifts *sp;
void
-set_reduction_table()
+set_reduction_table (void)
{
register reductions *rp;
void
-set_maxrhs()
+set_maxrhs (void)
{
register short *itemp;
register int length;
void
-initialize_LA()
+initialize_LA (void)
{
register int i;
register int j;
{
if (!consistent[i])
{
- if (rp = reduction_table[i])
+ if ((rp = reduction_table[i]))
for (j = 0; j < rp->nreds; j++)
*np++ = rp->rules[j];
}
void
-set_goto_map()
+set_goto_map (void)
{
register shifts *sp;
register int i;
/* Map_goto maps a state/symbol pair into its numeric representation. */
int
-map_goto(state, symbol)
-int state;
-int symbol;
+map_goto (int state, int symbol)
{
register int high;
register int low;
void
-initialize_F()
+initialize_F (void)
{
register int i;
register int j;
void
-build_relations()
+build_relations (void)
{
register int i;
register int j;
void
-add_lookback_edge(stateno, ruleno, gotono)
-int stateno;
-int ruleno;
-int gotono;
+add_lookback_edge (int stateno, int ruleno, int gotono)
{
register int i;
register int k;
short **
-transpose(R_arg, n)
-short **R_arg;
-int n;
+transpose (short **R_arg, int n)
{
register short **new_R;
register short **temp_R;
void
-compute_FOLLOWS()
+compute_FOLLOWS (void)
{
register int i;
void
-compute_lookaheads()
+compute_lookaheads (void)
{
register int i;
register int n;
void
-digraph(relation)
-short **relation;
+digraph (short **relation)
{
register int i;
void
-traverse(i)
-register int i;
+traverse (register int i)
{
register unsigned *fp1;
register unsigned *fp2;