From: Judson Lester Date: 2008-02-09T06:37:18+09:00 Subject: Re: ragel and ruby This is sort of unconsidered, but it might help. In order to get Ragel to work for me, I needed to add the following to the code definition template: %%{ write init; }%% mark = nil data = io.read p = 0 pe = data.length stack = [] top = 0 %%write exec; If I recall correctly, there's a way to go the other way: to have Ragel generate different code for getting the next character, but it's been a little while and I don't remember what it is. On Feb 8, 2008 12:49 PM, Philipp Hofmann wrote: > > > Hi, > > I've been trying to generate ruby with ragel. But the generated code > is complaing about undefined local variables > > Here an excerpt of the generated code: > > class MyParser > > # more generated code here ... > > class << self > attr_accessor :mymachine_start > end > > # and here ... > > def parse(input) > > # ... > > begin > cs = mymachine_start > end > > # ... > > end > > end > > If I prepend 'type.', which is deprecated, I know, it works for this > case. But there are other accessor that are being set private, e. g. > > attr_accessor :_mymachine_trans_actions_wi > private :_mymachine_trans_actions_wi, :_mymachine_trans_actions_wi= > > How is this mean to work? > > And why isn't an accessor set at class level not accessible from within > an instance of this class in the first place? > > g phil > > -- Your subnet is currently 169.254.0.0/16. You are likely to be eaten by a grue.