ZigZag was a previously identified micropattern of a nonterminal defined in a style that mixes horizontal production rules (the ones with a top-level choice) with vertical production rules (with several rules per nonterminal) [SLE-2013-Zaytsev]. In this fragment aaa
is horizontal, ddd
is vertical and ggg
is zigzag:
aaa ::= bbb | ccc;
ddd ::= eee; ddd ::= fff;
ggg ::= hhh | jjj; ggg ::= mmm;
When it comes to smells, we have at least two ways to define and detect ZigZags: the local one within a nonterminal (equal to the micropattern) and the global within a grammar. The latter would mean that some nonterminals are defined horizontally while others are defined vertically, which may not be technically detrimental, but is still sloppy.