[ragel-users] Re: Ruby and Java code generation
thurs... at cs.queensu.ca
Fri Sep 28 16:17:36 PDT 2007
Thanks, that should work well.
Now we just need something for Ruby. I noticed that Ruby case statements don't fall through.
From: Erich Ocean <erich at atlasocean.com>
Date: Fri, 28 Sep 2007 15:29:14
To:ragel-users at googlegroups.com
Subject: [ragel-users] Re: Ruby and Java code generation
Duff's device can be used with Java, so you might be able to use that
technique to jump back into the middle of the processing loop.
See http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html for
On Sep 28, 2007, at 3:23 PM, Adrian Thurston wrote:
> What is now needed in Ruby and Java code is a jump back into the
> processing loop just like that found at rlgen-cd/tabcodegen.cpp:1041.
> Adrian Thurston wrote:
>> Before loop breaks and variables were used in Ruby code call/cc
>> were used. This was found to be very slow (about 10 times slower than
>> the current). Do you think throw/catch would be any better than
>> Later today I'm going to commit my work on the C version. I'll
>> the part that is troublesome and maybe someone that knows Java and
>> well can suggest something.
>> Ryan King wrote:
>>> On Sep 28, 2007, at 12:02 PM, Adrian Thurston wrote:
>>>> I'm having some trouble with Ruby and Java code generation as I
>>>> implement 6.0 features. The main problem with targeting both of
>>>> languages is the lack of goto statement. This is problematic
>>>> even for
>>>> the table-driven machine. There are a number of places in the
>>>> where a jump in or jump out of the processing loop is required.
>>>> So far
>>>> I've gotten away with using named loops in Java and control flow
>>>> variables in Ruby, however with the latest changes things are
>>>> really ugly. I don't have a solution yet. I'm not sure what to do
>>>> now, so for the time being I will continue ahead with the 6.0
>>>> and stall work on Ruby and Java code generation.
>>> You can emulate GOTO-ish behavior in ruby with throw and catch:
>>> catch(:foo) do
>>> There are limits to how the code can be structured in these cases
More information about the ragel-users