File tree 4 files changed +21
-2
lines changed
4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,7 @@ extern char tflag;
210
210
extern char vflag ;
211
211
extern char qflag ;
212
212
extern char sflag ;
213
+ extern char eflag ;
213
214
extern char big_endian ;
214
215
215
216
extern char * myname ;
@@ -335,6 +336,7 @@ extern void output (void);
335
336
extern void over_unionized (char * u_cptr ) Noreturn ;
336
337
extern void prec_redeclared (void );
337
338
extern void polymorphic_entry_point (char * s ) Noreturn ;
339
+ extern void forbidden_conflicts (void );
338
340
extern void reader (void );
339
341
extern void reflexive_transitive_closure (unsigned int * R , int n );
340
342
extern void reprec_warning (char * s );
Original file line number Diff line number Diff line change @@ -313,3 +313,11 @@ void polymorphic_entry_point(char *s)
313
313
myname , s );
314
314
done (1 );
315
315
}
316
+
317
+ void forbidden_conflicts (void )
318
+ {
319
+ fprintf (stderr ,
320
+ "%s: the grammar has conflicts, but -e was specified\n" ,
321
+ myname );
322
+ done (1 );
323
+ }
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ char rflag;
30
30
char tflag ;
31
31
char vflag ;
32
32
char qflag ;
33
+ char eflag ;
33
34
char sflag ;
34
35
char big_endian ;
35
36
@@ -160,7 +161,7 @@ void set_signals(void)
160
161
161
162
void usage (void )
162
163
{
163
- fprintf (stderr , "usage: %s [-v] [-q] [-b file_prefix] filename\n" ,
164
+ fprintf (stderr , "usage: %s [-v] [-e] [- q] [-b file_prefix] filename\n" ,
164
165
myname );
165
166
exit (1 );
166
167
}
@@ -213,6 +214,10 @@ void getargs(int argc, char **argv)
213
214
usage ();
214
215
continue ;
215
216
217
+ case 'e' :
218
+ eflag = 1 ;
219
+ continue ;
220
+
216
221
default :
217
222
usage ();
218
223
}
Original file line number Diff line number Diff line change @@ -47,7 +47,11 @@ void make_parser(void)
47
47
find_final_state ();
48
48
remove_conflicts ();
49
49
unused_rules ();
50
- if (SRtotal + RRtotal > 0 ) total_conflicts ();
50
+ if (SRtotal + RRtotal > 0 ) {
51
+ total_conflicts ();
52
+ if (eflag )
53
+ forbidden_conflicts ();
54
+ }
51
55
defreds ();
52
56
}
53
57
You can’t perform that action at this time.
0 commit comments