2010/12/30 Iñaki Baz Castillo <[email protected]>: > Hi, I wonder if there is a way to parse (or not) some fragments of the > stream depending on previous parsed elements. > > For example, in HTTP, imagine I just want to parse a custom header > "X-MyHeader" (which has a specific value format) in case the request > method is POST. But in case it's a GET then I just want to store the > header raw value.
This is, there would be two valid syntax for "X-MyHeader": generic_value = any* -CRLF; x_value = [0-9] ":" [a-z]+; x_myheader_value = generic_value | x_value; If a previous field of the stream (the request method) is POST (an action could set a variable) I want 'x_myheader_value' just to be checked with 'x_value', and if the method is other, then 'x_myheader_value' should be just checked with 'generic_value'. Thanks for any suggestion or clarification. -- Iñaki Baz Castillo <[email protected]> _______________________________________________ ragel-users mailing list [email protected] http://www.complang.org/mailman/listinfo/ragel-users
