bol_needed = true;
if ( performance_report )
- fprintf( stderr,
- "'^' operator results in sub-optimal performance\n" );
+ pinpoint_message(
+ "'^' operator results in sub-optimal performance" );
}
}
bol_needed = true;
if ( performance_report )
- fprintf( stderr,
- "'^' operator results in sub-optimal performance\n" );
+ pinpoint_message(
+ "'^' operator results in sub-optimal performance" );
}
}
| EOF_OP
{
- /* this EOF applies only to the INITIAL start cond. */
- actvsc[actvp = 1] = 1;
- build_eof_action();
+ /* this EOF applies to all start conditions
+ * which don't already have EOF actions
+ */
+ actvp = 0;
+
+ for ( i = 1; i <= lastsc; ++i )
+ if ( ! sceof[i] )
+ actvsc[++actvp] = i;
+
+ if ( actvp == 0 )
+ pinpoint_message(
+ "warning - all start conditions already have <<EOF>> rules" );
+
+ else
+ build_eof_action();
}
| error
namelist2 : namelist2 ',' NAME
{
if ( (scnum = sclookup( nmstr )) == 0 )
- lerrsf( "undeclared start condition %s", nmstr );
+ format_pinpoint_message(
+ "undeclared start condition %s", nmstr );
else
actvsc[++actvp] = scnum;
| NAME
{
if ( (scnum = sclookup( nmstr )) == 0 )
- lerrsf( "undeclared start condition %s", nmstr );
+ format_pinpoint_message(
+ "undeclared start condition %s", nmstr );
else
actvsc[actvp = 1] = scnum;
}
* conditions
*/
-build_eof_action()
+void build_eof_action()
{
register int i;
for ( i = 1; i <= actvp; ++i )
{
if ( sceof[actvsc[i]] )
- lerrsf( "multiple <<EOF>> rules for start condition %s",
+ format_pinpoint_message(
+ "multiple <<EOF>> rules for start condition %s",
scname[actvsc[i]] );
else
/* synerr - report a syntax error */
-synerr( str )
+void synerr( str )
char str[];
{
}
+/* format_pinpoint_message - write out a message formatted with one string,
+ * pinpointing its location
+ */
+
+void format_pinpoint_message( msg, arg )
+char msg[], arg[];
+
+ {
+ char errmsg[MAXLINE];
+
+ (void) sprintf( errmsg, msg, arg );
+ pinpoint_message( errmsg );
+ }
+
+
/* pinpoint_message - write out a message, pinpointing its location */
-pinpoint_message( str )
+void pinpoint_message( str )
char str[];
{
* currently, messages are ignore
*/
-yyerror( msg )
+void yyerror( msg )
char msg[];
{