[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Parsing a ruby code

Zeeshan Haq

6/8/2008 3:00:00 PM

Hello,
I am using the below given code to parse ruby code line by line and
generate its s-expression (AST). The help i need from you is that i want
to parse the whole ruby file at a time instead of parsing line by line.

require "ruby_parser"
# puts RubyParser.new.parse("My name is defecto")
counter = 1
file = File.new("readfile.rb", "r")

while (line = file.gets)
puts "#{counter}: #{RubyParser.new.parse(line)}"
counter = counter + 1
end
--
Posted via http://www.ruby-....