You're right it won't work because the fcall transfers control
immediately. The fbreak is unreachable.
Try saving the return point to a var using the scanner name, changing
the fcall to fnext and then use fgoto (return_point) in place of the fret.
Adrian
Hi -
main := |*
A { fcall m1; fbreak; }
*|;
m1 := |*
B { fcall m2; fbreak; }
*|;
m2 := |*
C { fret; fret; fbreak; }
*|;
Although ragel will compile this, the generated C-code looks
like it will not work like I intend. There are two problems.
One I would like machine C to return back to main, but I don't
want to use fgoto because in the general case it may be a different
scanner that needs to be returned to. The other problem
is that I don't think the fbreaks will work. I really want to
return a token, then perform the fcall, or fret. Is this
even possible?
Thanks,
Eric West
_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users