Vadim Zaytsev aka @grammarware

GraSs: A Taxonomy of Grammar Smells


Organisation
global problems
Navigation
problems with navigating through the grammar
Structure
harmful relationships among grammar components

Convention
violations of visual policies
Notation
metalanguage-related
Parsing
parsing techniques related smells
Duplication
the same fragment is repeated

Misformat
misleading formatting
Misnomer
problems with naming policies
SayMyName
a misspelling or improper use of the natural language
ZigZag
mixing horizontal and vertical styles
Splat
nonterminal fragments scattered over the grammar

ZigZag Edit!

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.


The GraSs taxonomy is a joint effort maintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Page last updated in March 2021.
XHTML 1.1 CSS 3