TooWide

This smell is designed to recognise production rules which are too wide—that is, their right hand side is too long. There could be at least three ways to define what is “too long”: 1) The number of consequent terminals is too high, which is harmful because long streaks of consequent terminals obscure the syntactic structure. 2) The number of nonterminals is too high, which is harmful because it requires knowledge about referenced nonterminals to debug a grammar (so we should not count preterminals). 3) The number of metasymbols (stars, optionals, crosses, separator lists and other combinators) is too high, which is harmful because the importance of knowing the notation is stressed when a grammar engineer needs to understand such a production rule.

Related smells: Throwaway

Reference

Mats Stijlaart and Vadim Zaytsev. 2017. Towards a taxonomy of grammar smells. In Proceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering (SLE 2017). ACM, New York, NY, USA, 43-54.


Complexity Smells

Home

All rights reserved (c) Tushar Sharma 2017-23.