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

Echo
same rule occurs twice or more
Clone
same right hand side occurs twice or more
Foldable
nonterminal's right hand side is not unique
Common
common subexpressions
Permuted
permutations in commutative combinators
Lookalike
near-clones

Foldable Edit!

Related smells: Scattered Parasitic Functionality, Subsystem-API Bypassed, The Grand Old Duke of York, Broken Hierarchy, Broken Hierarchy

This smell occurs when the clone is formed not between full definitions of two nonterminals, but when the right hand side of one nonterminal occurs as a subexpression in the right hand side of another nonterminal. Conceptually they are still clones and suffer from all known consequences of coupled evolution, but the solution is different: instead of merging the nonterminals, the subexpression needs to be folded into a nonterminal that defines it.


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