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

Spaghetti
scattering details over the grammar
Shortage
incompleteness
Mixture
spicing the grammar with alien fragments

BadLayout
problems with whitespace and comments
Preprocessor
combining parsing spec with preprocessor spec

BadLayout Edit!

Dealing with layout and whitespace can be very tricky, and, as any tricky process, there may be issues with it. Some language workbenches offer default layout, which, again, may be smelly to use it or not to use it – we cannot provide any general guidelines. Not specifying any layout may be harmful in some cases as well.

One particular issue with layout can be explained in a bit of more detail. Usually there are two naturally different things covered by layout: whitespace (in software languages that ignore it) and comments (that do not influence behaviour of the system but can have an impact on its understanding). Mixing those two indiscriminately in the grammar may eventually lead to the point where it is required but impossible or overly complex to get one but not the other (e.g., for handling structured comments or preserving it through transformations).


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