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

Mythic Edit!

Related smells: Unnecessary Hierarchy, Speculative Generality, Speculative Hierarchy

Formal language theory defines a language extensionally, as a set of all possible programs written in it. A grammar is an intensional definition, which is nicer because it is a finite specification of an infinitely large entity, but it also makes it harder to see some relations between that and the instances of the language. In particular, the actual codebase of the software language, if available and comprehensive enough, can serve as a good approximation of the language features used by programmers. If a grammar contains a feature that is never exercised by any program in the actual codebase, it is a Mythic feature that, for instance, does not have to be supported for a software analysis or migration tool to be useful and applicable.


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