From: daz Date: 2003-12-13T09:46:59+09:00 Subject: Re: Ruby parser with character ranges Jonathan Edwards wrote: > Is there a parser for ruby syntax that identifies the exact ranges of > characters for each nonterminal? I need this to instrument ruby code. > Just getting line numbers is not adequate. > > Thanks, > Jonathan Referring to example in www.ruby-talk.org/83656 If the token has an associated value, use length of value or start position of following token. Comments are followed by TkNL. Strings end where the next token begins (e.g. TkSPACE / TkCOMMA ...) daz