In grammars cyclomatic complexity is easy to estimate if we think of the parsing semantics, and it will be rather close for any other concrete application of the grammar. Alternatives and all kinds of disjunction obviously contribute to its increase, as well as repetition metasymbols. Conjunction, if present, also contributes to the branching since a construct like A & B means that both the parser and the grammar engineer will have to explore both branches related to A as well as to B.
Related smells: TooNested
All rights reserved (c) Tushar Sharma 2017-23.