Author Topic: Flex Column Numbers  (Read 2109 times)

cman

  • Member
  • **
  • Posts: 199
Flex Column Numbers
« on: April 20, 2013, 01:07:45 AM »
What's the best way to associate line and column numbers with a token using Flex? I've tried something like this:

Code: [Select]
"token"               { sourceColumnNumber += yyleng; return tokenDefine; }
.........................
"\n"                     { sourceColumnNumber = 1; sourceLineNumber ++; }


I seem to get improper results with certain productions. Thanks for any information!