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

Proxy
indirect uses
Dependency
antipatterns in use
Complexity
metric-based smells

Chain
right hand side is a nonterminal
Throwaway
a nonterminal used only once
Weak
a nonterminal does not form a proper abstraction
Ghost
a subexpression that should have been a nonterminal
Multitool
a nonterminal that represents two or more concepts

Chain Edit!

Related smells: Lazy Class, Extraneous Adjacent Connector, Message Chains, Middle Man, Middle Man, Long Calculation Chain, Too Many Layers

Chain rules are a well-known smell in grammar engineering [IFM-2009-LammelZ][SCAM-J-2009-LammelZ11]: it happens when a nonterminal is defined with only one production rule which has exactly one nonterminal as its right hand side. The “inner” nonterminal acts like a middle man and does not play a significant rule in structural commitments of the grammar. In Fowler's words, “after a while it’s time to cut out the middle man and talk to the object that really knows what’s going on” [Refactoring].


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