Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #1212

Error message with bison and flex

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border4.nntp.dca.giganews.com!backlog4.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end
From laplante.p@gmail.com
Newsgroups comp.compilers
Subject Error message with bison and flex
Date Mon, 7 Apr 2014 22:36:46 -0700 (PDT)
Organization Compilers Central
Lines 17
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <14-04-005@comp.compilers> (permalink)
NNTP-Posting-Host news.iecc.com
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
X-Trace miucha.iecc.com 1397139489 66628 2001:470:1f07:1126:0:676f:7373:6970 (10 Apr 2014 14:18:09 GMT)
X-Complaints-To abuse@iecc.com
NNTP-Posting-Date Thu, 10 Apr 2014 14:18:09 +0000 (UTC)
Keywords yacc, errors
Posted-Date 10 Apr 2014 10:18:09 EDT
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
X-Original-Bytes 1623
Xref csiph.com comp.compilers:1212

Show key headers only | View raw


Sometime the text return from a syntax error is very short.

I would like to output 5 lines before the error and
5 lines after the error.

Is this possible without affecting the error message.

If I used input to read the next 5 lins, the message won't be the same and
I don't want to always accumulate the 5 lines before, it will add a lot of overhead to the lexical analyser.

Tx
[The way I'd do it would be to write my own YY_INPUT() that slurps in
the whole file to a buffer when it starts and hands the input to the
lexer a line at a time, so it knows what line it's on.  If there's an
error, it can then scan forward and backward in the file buffer to find
the five lines each way. -John]

Back to comp.compilers | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Error message with bison and flex laplante.p@gmail.com - 2014-04-07 22:36 -0700
  Re: Error message with bison and flex Kaz Kylheku <kaz@kylheku.com> - 2014-04-10 15:06 +0000
    Re: Error message with bison and flex Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2014-04-11 03:30 +0200
      Re: Error message with bison and flex glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-04-12 03:31 +0000

csiph-web