From: "Thillai S." Date: 2010-12-31T13:40:38+09:00 Subject: Re: Parsing the Ruby File Ryan Davis wrote in post #971438: > On Dec 30, 2010, at 2:56, "Thillai S." wrote: > >> But I want to know the line number in which the sub routine is ending > > What are you actually trying to do? Thanks for ur reply! Say for example a sub routine definition is starting in the line number 15 The end of the sub routine definition is there is some line x. I want to know the line number x through a script. Example consider the ruby program #!/usr/bin/ruby #first line of the program ################################################################################# # DESCRIPTION : xxxxxxxx # AUTHOR : yyyyyyyy ################################################################################# # a sample test function def test #8th line of the program xxxxxxxxxx; #9th line yyyyyyyyyy; #10th line end #11th line -- function test ends here Here the function test defition starts in the line number 8. The ending line test function is 11. The ctags -x will return the starting line number of the testing function like, test subroutine 8 file_name.pl sub test() So from the output of the ctags command I can get the line number of the test function definition starting. Similarly I want to get the ending line number of the sub routine. How can we achieve this? Please help me... -- Posted via http://www.ruby-forum.com/.