help-flex
[Top][All Lists]
Advanced

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

Re: Locations suggest


From: John W. Millaway
Subject: Re: Locations suggest
Date: Thu, 3 Jan 2002 12:22:39 -0800 (PST)

> One way to implement the column number might be to every time a newline
> '\n' is encountered, its file position number is recorded. From that file
> position number and the current file position number, the column number can
> be computed.

That will fail when yyin == stdin. Why not just record the column number
instead?

> It is already possible to have an action executed before any scanning takes
> place, and YY_USER_ACTION can be used to record the location after the
> scanning has been done. Perhaps one should add special YY_LOCATION_BEGIN
> and YY_LOCATION_END macros.

To generalize on this a bit, we need a macro that executes just before a return
from a user action. But this is a big of a fish to fry (detecting a return
statement in actions). Instead, I usually define YY_RETURN, and use that
instead of a normal 'return' statement.



__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com



reply via email to

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