line number in bison yyerror

Pepe <>
12 Feb 2004 11:02:45 -0500

          From comp.compilers

Related articles
line number in bison yyerror (Pepe) (2004-02-12)
| List of all articles for this month |

From: Pepe <>
Newsgroups: comp.compilers
Date: 12 Feb 2004 11:02:45 -0500
Organization: tp.internet -
Keywords: yacc, errors, question
Posted-Date: 12 Feb 2004 11:02:44 EST

Can someone give me an example how to report line numbers in bison yyerror
function, if
1) bison uses %pure-parser and %locations
2) flex uses %option reentrant bison-bridge bison-locations yylineno

Do I have to include code of my own in the lex/bison file to make it work?
Right now, yyget_lineno() gives always 1 and yylloc->first_line fantasy
numbers (e.g. very large and negative).

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.