How to get more parse error information from lex / yacc?
Currently in the lex file I am using:
int yyerror(const char *msg)
{
fprintf(stderr, "Parse error: %s\n", msg);
return 0;
}
But when I run my program yyerror outputs a blank message. I tried adding yylineno and yytext to yyerror but these cause compilation errors. I tried adding "%error-verbose" to the yacc file and "%option debug" to the lex file but these made no difference to the message.
I did notice however that yyparse outputs a bracket: '{' from the file I am trying to parse, I don't know the significance of this.
I am using win_flex and win_bison.