in that there is no "sublanguage" for describing permutation parsers. you can use your regular HParsers as arguments to h_permutation. optional elements work with h_optional as one would intuitively expect. what is not supported in the same way, in relation to the above paper, are optional elements with default values. you can have a parser that is a choice with a default branch of course, but the difference is that it might be tried too early, depending on its place in the argument list, and default even though it could match later. so to get the same result, one would have to use plain optionals and replace the TT_NONE results with default values after the fact.
please have a look. it differs from
http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=D04D91DBBCDDDF3D364C17C4DAD59606?doi=10.1.1.20.8347&rep=rep1&type=pdf
in that there is no "sublanguage" for describing permutation parsers. you can use your regular
HParser
s as arguments toh_permutation
. optional elements work withh_optional
as one would intuitively expect. what is not supported in the same way, in relation to the above paper, are optional elements with default values. you can have a parser that is a choice with a default branch of course, but the difference is that it might be tried too early, depending on its place in the argument list, and default even though it could match later. so to get the same result, one would have to use plain optionals and replace theTT_NONE
results with default values after the fact.