This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Flex] Getting the absolute input file position


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]