grammar including unions and extensions