Original Post
So I''m trying to get bison (1.85) to report line numbers for syntax errors. I have flex assigning to yylloc, and the %locations directive in the grammar file, and all that business. I can get the @n values beautifully for non-syntax-errors. But in cases where bison can''t match a rule, it fires off the syntax error message before I can set a line number for it to use (it fires it off before performing the error action in any rule). I even tried it in the YYLLOC_DEFAULT, but that''s performed afterwards too.
I guess I need to know what yyerror() needs to access when reporting a syntax error. Is there an internal variable which stores the correct yylloc for the erroneous token?
I like pie.