Re: line and column numbers
Henrik Sorensen <[email protected]> Tue, 14 Feb 2006 11:23:30 +0000
| Newsgroups | gmane.comp.lex.flex.general |
|---|---|
| Message-ID | <[email protected]> |
On Tuesday 14 February 2006 01.39, Josh wrote:
> Does anyone know of a clever way to find the column count in GNU flex
> scanner?
I dont know if it is clever, but I have wrapped all the RETURN from a rule in
a macro, that do the bean counting.
The linenumbering is done by one rule:
<INITIAL>\n|\r {
l$++; // line counter
c$=0; // column counter
o$+=yyleng; //offset counter
}
for more details see pl1gcc.sourceforge.net or mail me directly.
>
> Josh
Henrik