protected static int computeLineNo ( Node node ) { final int offset = node . getStartOffset ( ) ; final BasedSequence seq = node . getDocument ( ) . getChars ( ) ; int tmpOffset = seq . endOfLine ( 0 ) ; int lineno = 1 ; while ( tmpOffset < offset ) { ++ lineno ; tmpOffset = seq . endOfLineAnyEOL ( tmpOffset + seq . eolLength ( tmpOffset ) ) ; } return lineno ; }
Compute the number of lines for reaching the given node .