[ragel-users] Greedy star operator

Alexander Laslavic alex.laslavic at turner.com
Tue Jul 20 18:56:57 UTC 2010


This is a problem I come up against over and over again:

    action start_text { printf("start_text") }
    action end_text {printf("end_text")}

    text = any**;
    Text = text >start_text %end_text;

    Element = Text;

    main := Element*;


Essentially, the start_text and end_text actions get called for every
character.  If I take the star operator off of Element, it works fine, but
if Element has a star operator, ragel is preferring to repeat the Element
over repeating the any** in 'text'.

Is there some way I am not aware of to get it to prefer the inner
repitition?


-- 
Alex Laslavic
Lead Engineer - Turner DMT


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



More information about the ragel-users mailing list