* Adrian Thurston ([email protected]) wrote:

> Sorry I went to fast and didn't see your problem. My mail program was 
> highlighting the lines beginning with ">", causing some confusion for me.
> 
> The bit of info that you're missing is that action embedding operators 
> bind more tightly than concatenation. Use:
> 
> b := ( a 'b'+ ) >{print} %{print};
> 
> and I think you'll get what you want.

That would be too easy :)

Actually that was just an example, the real cause is more complex,
and my goal is to save all informaion encountered while parsing
subexpression amd process it as a whole when it's finished. Like
that:

char *a_start;
char *a_end;

a = 'a'+
    > { a_start = p; }
    % { a_end = p; }
;

b = a 'b'+
    > { a_start = a_end = 0; /* reset state */ }
    % { printf("subexpr finished, there were %d a's\n", a_end-a_start); }
;

main := b+;

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
[email protected]  ..:  jabber: [email protected]    http://www.amdmi3.ru

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

Reply via email to