using instanceof instead of adding irrelevant methods on grammar slots