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

Underuse
inferior substitutes are used instead of an available feature
Overspec
the same constraint specified through several means
Priorities
not present or circular
Singleton
trivial choice, sequence or conjunction
Combo
double modifier creates an ambiguity
Chant
comments cover up bad code
Deprecated
the use of a feature that is no longer welcome
Exotic
too idiosyncratic notational features decrease portability

Combo Edit!

Related smells: Useless Control Flow

Grammar combinators (metasymbols of arity 1 and up) such as the Kleene star and cross, or an optional, can be combined in an improper way. For example, a grammar engineer who defines A ::= B?; and B ::= C?;, may mean well, but creates a confusing contract if A is used to bind a textual structure with a tree structure: it is ambiguous what an empty string corresponds to – an empty node A or a node A containing an empty node B. Some of these issues may be harder to detect due to indirection, but they are all automatically fixable.


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