hi eduard,

On Mon, Nov 12, 2012 at 10:25:28PM +0200, Eduard Bondarenko wrote:
> How to implement recursive rules like:
> 
> if <condition> then
>      if <condition2> then
>      end
> end

the short answer is: you dont. ragel is a parser for regular languages,
and your example is not regular due to the recursion you are after. you
could however use ragel as your lexer and use something else as your
parser. if the number of such recursion cases is limited then you can
get away with just using ragel, byt essentially pushing the current
state onto a state, see fcall/fret in the ragel manual.

regards  robert

-- 
Robert Lemmen                               http://www.semistable.com 

Attachment: signature.asc
Description: Digital signature

_______________________________________________
ragel-users mailing list
ragel-users@complang.org
http://www.complang.org/mailman/listinfo/ragel-users

Reply via email to