Implementation of sequence parser