help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Flex] Getting the absolute input file position


From: Hans Aberg
Subject: Re: [Flex] Getting the absolute input file position
Date: Sat, 16 Jul 2005 20:31:35 +0200

On 16 Jul 2005, at 19:56, address@hidden wrote:

So as long as "every other rules", move the file offset properly,
I'm in business.

The lexer reads a chunk from the file into its buffer, and then forgets about the file and its file position. So no rule moves the file offset at all; it is only changed when the buffer runs out of characters, and needs to be refilled.

In a lexer .c file with this option on, there is a segment right
before the lexer switch statement that looks something like:

This seems more "acceptable".

How does it manage unput and similar re-feed?

All stuff is handled via the lexer buffer, and no stuff is put back into the file.

if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{
  yyfilepos += yyleng;
}


You should have something like that.

  Hans Aberg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]