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

Factoring
improper factoring or distribution
1SidedRecursion
left or right recursive rules
Superset
parser spec is too relaxed
Shotgun
a chunk of input could be parsed in more detail
NoDefault
no error-localising default branch
Action
a code smell in a semantic action

Action Edit!

Related smells: Switch Redundant Assignment, Circuitous Treasure Hunt, Excessive Dynamic Allocation, The One Lane Bridge, Mystery Guest, Resource Optimism, Invalid Property Value, Inappropriate Intimacy, Type Queries, Unexploited Encapsulation, Obscure In-Line Setup, Functional Decomposition

Many realistic language workbenches draw the line to prevent endless growing of their notations, and introduce a concept of a “semantic action”, which is written like an annotation in the grammar and acts as a doorway to the mainstream language typical for the target platform [SLE-2013-ErdwegSVBBCGHKLKMPPSSSVVVWW]. Obviously, since this action consists of code, the code can suffer from one of the numerous code smells.


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