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


Groups > comp.compilers > #1595

lex - how to get current file position of parser file

Path csiph.com!au2pb.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end
From Jens Kallup <jkallup@web.de>
Newsgroups comp.compilers
Subject lex - how to get current file position of parser file
Date Tue, 1 Sep 2015 04:20:53 +0200
Organization Aioe.org NNTP Server
Lines 29
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <15-08-019@comp.compilers> (permalink)
NNTP-Posting-Host news.iecc.com
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
X-Trace miucha.iecc.com 1441076872 85621 2001:470:1f07:1126:0:676f:7373:6970 (1 Sep 2015 03:07:52 GMT)
X-Complaints-To abuse@iecc.com
NNTP-Posting-Date Tue, 1 Sep 2015 03:07:52 +0000 (UTC)
Keywords lex, question
Posted-Date 31 Aug 2015 23:07:52 EDT
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
Xref csiph.com comp.compilers:1595

Show key headers only | View raw


Hello,

I used flex, and bison under Linux.  But how can I handle multiple
input files?  When I follow the examples of the documentation, I fail
to handle tokens after include file.

Example:

PRINT "Before"
SET PROCEDURE TO testproc
PRINT "After"

this is a abstract language, which does (should) open a file called
"testproc".

But I can not handle line 3.
I try to "ftell" the position after testproc,
but get the size of the parser file.

So, now I have no glue, how to fix that.  It would be great, if
someone have a idea, and maybe a short code snippet.

Thanks
Jens
[Flex buffers its input, so you can't just do an ftell().  Use the
yy_create_buffer() and related routines.  If you have a copy of my
book "flex & bison" there's an example of nested include files in
chapter 2. -John]

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


Thread

lex - how to get current file position of parser file Jens Kallup <jkallup@web.de> - 2015-09-01 04:20 +0200
  Re: lex - how to get current file position of parser file Kaz Kylheku <kaz@kylheku.com> - 2015-09-01 14:19 +0000
    Re: lex - how to get current file position of parser file federation2005@netzero.com - 2015-09-03 15:47 -0700
      Re: include files, was lex - how to get current file position of parser file Kaz Kylheku <kaz@kylheku.com> - 2015-09-04 05:26 +0000
    Re: lex - how to get current file position of parser file Gene Wirchenko <genew@telus.net> - 2015-09-03 18:19 -0700
      Re: lex - how to get current file position of parser file Jens Kallup <jkallup@web.de> - 2015-09-06 21:53 +0200
        Re: lex - how to get current file position of parser file Kaz Kylheku <kaz@kylheku.com> - 2015-09-07 05:59 +0000
    Re: lex - how to get current file position of parser file Jens Kallup <jkallup@web.de> - 2015-09-07 17:11 +0200

csiph-web