[ragel-users] Re: Ruby and Java code generation

Adrian Thurston thurs... at cs.queensu.ca
Fri Sep 28 20:04:06 UTC 2007


Before loop breaks and variables were used in Ruby code call/cc features
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 call/cc?

Later today I'm going to commit my work on the C version. I'll highlight
the part that is troublesome and maybe someone that knows Java and Ruby
well can suggest something.

Adrian

Ryan King wrote:
> On Sep 28, 2007, at 12:02 PM, Adrian Thurston wrote:
>> Hi,
>>
>> I'm having some trouble with Ruby and Java code generation as I
>> implement 6.0 features. The main problem with targeting both of these
>> languages is the lack of goto statement. This is problematic even for
>> the table-driven machine. There are a number of places in the driver
>> 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 getting
>> really ugly. I don't have a solution yet. I'm not sure what to do  
>> right
>> now, so for the time being I will continue ahead with the 6.0 features
>> and stall work on Ruby and Java code generation.
> 
> You can emulate GOTO-ish behavior in ruby with throw and catch:
> 
> 
> catch(:foo) do
>   ...
>   throw(:foo)
>   ...
> end
> 
> There are limits to how the code can be structured in these cases (in  
> blocks).
> 
> -ryan
> 
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "ragel-users" group.
> To post to this group, send email to ragel-users at googlegroups.com
> To unsubscribe from this group, send email to ragel-users-unsubscribe at googlegroups.com
> For more options, visit this group at http://groups.google.com/group/ragel-users?hl=en
> -~----------~----~----~----~------~----~------~--~---
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20070928/efeb0232/attachment-0001.sig>


More information about the ragel-users mailing list