1: extern int yyline; /* input line number */ 2: 3: yyerror(s) char *s; { 4: extern int yychar; 5: extern char *yysterm[]; 6: printf("\n%s", s ); 7: if( yyline ) printf(", line %d,", yyline ); 8: printf(" on input: "); 9: if( yychar >= 0400 ) printf("%s\n", yysterm[yychar-0400] ); 10: else switch ( yychar ) { 11: case '\t': printf( "\\t\n" ); return; 12: case '\n': printf( "\\n\n" ); return; 13: case '\0': printf( "$end\n" ); return; 14: default: printf( "%c\n" , yychar ); return; 15: } 16: }