Edited grammar to not have non-terminal nodes without children. getTokenType() method doesn't use 'instanceof' operator.