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

Diamond
A is X and B is X, but C is A or B
Rivalry
overlapping alternatives
Ouroboros
a circular dependency among modules
Soulmates
nonterminals or modules are always changed together
Spillover
a nonterminal that is too linked to the adjacent symbols
Mythic
an alternative that is never exercised in the codebase

Ouroboros Edit!

Related smells: Dependency Cycles between Packages/Subsystems, Cyclically-dependent Modularization, Static Cycles in Dependency Graphs

If nonterminals are mutually, say, left recursive, and have no non-recursive alternatives, they are useless and cannot express a proper syntactic commitment. However, a similar issue may be encountered on the level of modules, and it is harder to detect for a human because modular grammars are already stretching comprehension capabilities of a grammar engineer. Such circular dependencies are fairly easy to detect automatically with a tool.


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