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

_______________________________________________
ragel-users mailing list
[email protected]
http://www.complang.org/mailman/listinfo/ragel-users

Reply via email to