Added undo and clear methods for parser class