[ragel-users] How to call an 'action' from other 'action' ?

Iñaki Baz Castillo ibc at aliax.net
Wed Feb 18 19:42:17 UTC 2009


Hi, I'm trying the following (using Ruby host language):


	action _start { start = p }
	action _stop { stop = p-1 ; value = data[start..stop].pack('c*') ; }
	action set_user { _stop ; user = value ; puts "---user=#{user}---" }
	
	user = ( unreserved | escaped | user_unreserved )+ >_start %set_user  ;


What I want to do is avoid writting the stuff in '_stop' action in every 
leaving action (%). But it seems to fail since '_stop' is executed as Ruby 
language:
  ERROR: undefined local variable or method `_stop'


How could I invoke '_stop' action from 'set_user' action?

Thanks.


-- 
Iñaki Baz Castillo




More information about the ragel-users mailing list