Here’s the problem occurred to me.
I’m having several tcl files like this:
I defined a couple of proc like proc data, to auto generate arrays for
(arrays in tcl is like hash in ruby)
I just source file_name in my tcl_project, so that those arrays are
because of this, I might have something like :
source a.tcl ;# a.tcl is another data file
Now I have to let ruby understand all these data files.
Options that I’m having:
1 translate all data files to xml, let ruby parse xml files
I’ve already tried the first one, but the result isn’t so good,
new xml files are hard to understand and maintain.
2 write my own ruby parser,
I’ve tried google, there seems to be a couple of ruby parser on
rubyforge. not look into it till now.
3 call tcl in ruby to parse all those files.
I’ve found that there’s no tcl_array_to_ruby_hash function
available in ruby/tk package.
I think the best way is to keep the current format, but I’m not sure
if it is the right thing to do.
so does any body have experiences on this kind of staff or any
suggestions or ideas?