From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3636 invoked by alias); 16 Jul 2005 04:33:20 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 3628 invoked by uid 22791); 16 Jul 2005 04:33:17 -0000 Received: from mxout.hispeed.ch (HELO smtp.hispeed.ch) (62.2.95.247) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 16 Jul 2005 04:33:17 +0000 Received: from [192.168.0.6] (84-72-190-54.dclient.hispeed.ch [84.72.190.54]) (authenticated bits=0) by smtp.hispeed.ch (8.12.6/8.12.6/tornado-1.0) with ESMTP id j6G4XFaV003452 for ; Sat, 16 Jul 2005 06:33:15 +0200 From: Henrik Sorensen Reply-To: henrik.sorensen@balcab.ch To: gcc@gcc.gnu.org Subject: Re: [Flex] Getting the absolute input file position Date: Sat, 16 Jul 2005 04:33:00 -0000 User-Agent: KMail/1.8.1 References: <1121391757.42d7148d9e6ca@mail.encs.concordia.ca> In-Reply-To: <1121391757.42d7148d9e6ca@mail.encs.concordia.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507160627.50571.henrik.sorensen@balcab.ch> X-DCC-spamcheck-01.tornado.cablecom.ch-Metrics: smtp-08.tornado.cablecom.ch 32700; Body=1 Fuz1=1 Fuz2=1 X-SW-Source: 2005-07/txt/msg00654.txt.bz2 On Friday 15 July 2005 03.42, f_plouff@cse.concordia.ca wrote: > I need to figure out how I can augment the generated file to get > the absolute input file position within two rules: > start file position...end file position. In the pl1gcc project, I have implemented token offsets across multiple input files for the scanner. Don't expect too much help from Flex though. You will have to code the beancounting yourself. I had to extend the YYLTYPE structure: typedef struct pl1ltype { int first_file; int first_line; int first_column; int first_offset; int last_file; int last_line; int last_column; int last_offset; } pl1ltype; #define YYLTYPE pl1ltype pl1gcc.sourceforge.net hope this helps you Henri