On 12/17/2011 8:31 AM, Marc Heiler wrote:
> Hi.
>
> Say I write something in Ruby. Then I want to translate this code
> into C.
>
> I do not aim for 100% translation. 60% is sufficiently well.
>
> For instance, think you are using only classes, and "def method"
> in those classes. No metaprogramming, no blocks etc...
>
> You use only a small subset of Ruby.
>
> And now you want to translate this into C. (Pure C, not Ruby-C).
>
> I can do this by hand (if given enough time), but I want to reduce
> this amount spent.
>
> The language C is just an example. You can insert any-other language
> into this.
>
> My question is - how to approach this goal?
>
> My most simple way would be via using readlines of the .rb file
> and then analyzing it. And then inserting what seems appropriate.
>
> But I could do this without the use of a scanner.
>
> Do I have to use a scanner though and tokenize the stream?
>
also see
3) RubyToC