Most chains will be forbidden by the well-formed analysis (see #66). I think that other chains are not incorrect (&&e or e+* for example) but are just bad style or weird. IMHO, a syntactic analysis is enough if we restrict only one prefix and suffix for a single expression. For prefixes, !e is like not e in logic and &e like e, indeed & is just a syntactic sugar for !!e. Thus we can see & as a hint to the parser generator to avoid consuming input, it is an identity function with regards to the result of e. Since this hint is already provided by !e, chaining & and ! is useless. We have these equivalences:
This time we clearly see that both leads to an infinite loop, and this is already checked by the well-formed grammar analysis. It remains the two others cases that still need an analysis.
Most chains will be forbidden by the well-formed analysis (see #66). I think that other chains are not incorrect (
&&e
ore+*
for example) but are just bad style or weird. IMHO, a syntactic analysis is enough if we restrict only one prefix and suffix for a single expression. For prefixes,!e
is likenot e
in logic and&e
likee
, indeed&
is just a syntactic sugar for!!e
. Thus we can see&
as a hint to the parser generator to avoid consuming input, it is an identity function with regards to the result ofe
. Since this hint is already provided by!e
, chaining&
and!
is useless. We have these equivalences:Let's write down the cases for suffixes:
This time we clearly see that both leads to an infinite loop, and this is already checked by the well-formed grammar analysis. It remains the two others cases that still need an analysis.