This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [Flex] Getting the absolute input file position
- From: Henrik Sorensen <henrik dot sorensen at balcab dot ch>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 16 Jul 2005 06:27:50 +0200
- Subject: Re: [Flex] Getting the absolute input file position
- References: <1121391757.42d7148d9e6ca@mail.encs.concordia.ca>
- Reply-to: henrik dot sorensen at balcab dot ch
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