]> git.saurik.com Git - bison.git/blobdiff - src/conflicts.c
* tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
[bison.git] / src / conflicts.c
index c2521909daae874cb3a853802e8cc07b5a5eba86..b201562007fe5a2588a757b7aa7d61754f8de4d4 100644 (file)
@@ -15,7 +15,8 @@ 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, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 #include "system.h"
@@ -35,19 +36,26 @@ extern unsigned *LA;
 extern short *LAruleno;
 extern short *lookaheads;
 extern int verboseflag;
-
-void set_conflicts();
-void resolve_sr_conflict();
-void flush_shift();
-void log_resolution();
-void total_conflicts();
-void count_sr_conflicts();
-void count_rr_conflicts();
+extern int fixed_outfiles;
+
+extern void initialize_conflicts PARAMS((void));
+extern void conflict_log PARAMS((void));
+extern void verbose_conflict_log PARAMS((void));
+extern void print_reductions PARAMS((int));
+extern void finalize_conflicts PARAMS((void));
+
+static void set_conflicts PARAMS((int));
+static void resolve_sr_conflict PARAMS((int, int));
+static void flush_shift PARAMS((int, int));
+static void log_resolution PARAMS((int, int, int, char *));
+static void total_conflicts PARAMS((void));
+static void count_sr_conflicts PARAMS((int));
+static void count_rr_conflicts PARAMS((int));
 
 char any_conflicts;
-char *conflicts;
 errs **err_table;
 int expected_conflicts;
+static char *conflicts;
 
 
 static unsigned *shiftset;
@@ -59,7 +67,7 @@ static int rrc_count;
 
 
 void
-initialize_conflicts()
+initialize_conflicts (void)
 {
   register int i;
 /*  register errs *sp; JF unused */
@@ -77,9 +85,8 @@ initialize_conflicts()
 }
 
 
-void
-set_conflicts(state)
-int state;
+static void
+set_conflicts (int state)
 {
   register int i;
   register int k;
@@ -164,10 +171,8 @@ It has already been checked that the rule has a precedence.
 A conflict is resolved by modifying the shift or reduce tables
 so that there is no longer a conflict.  */
 
-void
-resolve_sr_conflict(state, lookaheadnum)
-int state;
-int lookaheadnum;
+static void
+resolve_sr_conflict (int state, int lookaheadnum)
 {
   register int i;
   register int mask;
@@ -267,10 +272,8 @@ int lookaheadnum;
 /* turn off the shift recorded for the specified token in the specified state.
 Used when we resolve a shift-reduce conflict in favor of the reduction.  */
 
-void
-flush_shift(state, token)
-int state;
-int token;
+static void
+flush_shift (int state, int token)
 {
   register shifts *shiftp;
   register int k, i;
@@ -290,10 +293,8 @@ int token;
 }
 
 
-void
-log_resolution(state, LAno, token, resolution)
-int state, LAno, token;
-char *resolution;
+static void
+log_resolution (int state, int LAno, int token, char *resolution)
 {
   fprintf(foutput,
          _("Conflict in state %d between rule %d and token %s resolved as %s.\n"),
@@ -302,7 +303,7 @@ char *resolution;
 
 
 void
-conflict_log()
+conflict_log (void)
 {
   register int i;
 
@@ -325,7 +326,7 @@ conflict_log()
   
 
 void
-verbose_conflict_log()
+verbose_conflict_log (void)
 {
   register int i;
 
@@ -365,11 +366,9 @@ verbose_conflict_log()
 }
 
 
-void
-total_conflicts()
+static void
+total_conflicts (void)
 {
-  extern int fixed_outfiles;
-
   if (src_total == expected_conflicts && rrc_total == 0)
     return;
 
@@ -409,9 +408,8 @@ total_conflicts()
 }
 
 
-void
-count_sr_conflicts(state)
-int state;
+static void
+count_sr_conflicts (int state)
 {
   register int i;
   register int k;
@@ -477,9 +475,8 @@ int state;
 }
 
 
-void
-count_rr_conflicts(state)
-int state;
+static void
+count_rr_conflicts (int state)
 {
   register int i;
   register int j;
@@ -525,8 +522,7 @@ int state;
 
 
 void
-print_reductions(state)
-int state;
+print_reductions (int state)
 {
   register int i;
   register int j;
@@ -541,7 +537,7 @@ int state;
   register int m;
   register int n;
   register int default_LA;
-  register int default_rule;
+  register int default_rule = 0;
   register int cmax;
   register int count;
   register shifts *shiftp;
@@ -745,7 +741,7 @@ int state;
 
 
 void
-finalize_conflicts()
+finalize_conflicts (void)
 {
   FREE(conflicts);
   FREE(shiftset);