stanonik@nprdc (02/20/85)
The value of yychar displayed with yydebug enabled is almost always -1 due to yychar being discarded shortly after shifting. The devious logic of yaccpar defeated efforts to fix the display of yychar with yystate, so instead yaccpar was changed to display yychar while shifting and reducing. Along the way an assignment was found which never seemed to be used. Ron Stanonik stanonik@nprdc RCS file: RCS/yaccpar,v retrieving revision 1.1 diff -r1.1 yaccpar 40c40 < if( yydebug ) printf( "state %d, char 0%o\n", yystate, yychar ); --- > if( yydebug ) printf( "state %d\n", yystate ); 56a57,59 > #ifdef YYDEBUG > if( yydebug ) printf( "shift %d\n", yychar ); > #endif 103d105 < yyn = yypact[*yyps]; 137c139 < if( yydebug ) printf("reduce %d\n",yyn); --- > if( yydebug ) printf("reduce %d, token\n", yyn, yychar);