[ragel-users] Problem with an indetermination
Iñaki Baz Castillo
ibc at aliax.net
Wed Feb 11 20:39:00 UTC 2009
Hi, I'm finishing a complete SIP protocol parser with Ragel, but I have an
issue I can't solve. The problem is basically the following (I use Ruby):
--------------
name = ( token ( SP token )* ) > { _tag = p }
%{ @value = data[_tag..p-1].pack("c*"); puts "--name=#{@value}--"} ;
full = name SP* "<" [a-z]+ ">" ;
main := full
--------------
I parse the following valid string:
'Alice Kiske <alice>'
and I get two results for "name" node:
--name=Alice--
--name=Alice Kiske--
Obviously I just want the second result, the first one shouldn't occur.
I've solved similar problems using priorities but they don't help me in this
issue. Any help please?
Thanks a lot.
--
Iñaki Baz Castillo
More information about the ragel-users
mailing list